Skip to content

Commit 06b7ef7

Browse files
committed
Merge tag 'drm-fixes-2024-02-23' of git://anongit.freedesktop.org/drm/drm
Pull drm fixes from Dave Airlie: "This is the weekly drm fixes. Non-drivers there is a fbdev/sparc fix, syncobj, ttm and buddy fixes. On the driver side, ivpu, meson, i915 have a small fix each. Then amdgpu and xe have a bunch. Nouveau has some minor uapi additions to give userspace some useful info along with a Kconfig change to allow the new GSP firmware paths to be used by default on the GPUs it supports. Seems about the usual amount for this time of release cycle. fbdev: - fix sparc undefined reference syncobj: - fix sync obj fence waiting - handle NULL fence in syncobj eventfd code ttm: - fix invalid free buddy: - fix list handling - fix 32-bit build meson: - don't remove bridges from other drivers nouveau: - fix build warnings - add two minor info parameters - add a Kconfig to allow GSP by default on some GPUs ivpu: - allow fw to do initial tile config i915: - fix TV mode amdgpu: - Suspend/resume fixes - Backlight error fix - DCN 3.5 fixes - Misc fixes xe: - Remove support for persistent exec_queues - Drop a reduntant sysfs newline printout - A three-patch fix for a VM_BIND rebind optimization path - Fix a modpost warning on an xe KUNIT module" * tag 'drm-fixes-2024-02-23' of git://anongit.freedesktop.org/drm/drm: (27 commits) nouveau: add an ioctl to report vram usage nouveau: add an ioctl to return vram bar size. nouveau/gsp: add kconfig option to enable GSP paths by default drm/amdgpu: Fix the runtime resume failure issue drm/amd/display: fix null-pointer dereference on edid reading drm/amd/display: Fix memory leak in dm_sw_fini() drm/amd/display: fix input states translation error for dcn35 & dcn351 drm/amd/display: Fix potential null pointer dereference in dc_dmub_srv drm/amd/display: Only allow dig mapping to pwrseq in new asic drm/amd/display: adjust few initialization order in dm drm/syncobj: handle NULL fence in syncobj_eventfd_entry_func drm/syncobj: call drm_syncobj_fence_add_wait when WAIT_AVAILABLE flag is set drm/ttm: Fix an invalid freeing on already freed page in error path sparc: Fix undefined reference to fb_is_primary_device drm/xe: Fix modpost warning on xe_mocs kunit module drm/xe/xe_gt_idle: Drop redundant newline in name drm/xe: Return 2MB page size for compact 64k PTEs drm/xe: Add XE_VMA_PTE_64K VMA flag drm/xe: Fix xe_vma_set_pte_size drm/xe/uapi: Remove support for persistent exec_queues ...
2 parents b6d6928 + 72fa02f commit 06b7ef7

40 files changed

+183
-190
lines changed

arch/sparc/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ libs-y += arch/sparc/prom/
6060
libs-y += arch/sparc/lib/
6161

6262
drivers-$(CONFIG_PM) += arch/sparc/power/
63-
drivers-$(CONFIG_FB) += arch/sparc/video/
63+
drivers-$(CONFIG_FB_CORE) += arch/sparc/video/
6464

6565
boot := arch/sparc/boot
6666

arch/sparc/video/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
# SPDX-License-Identifier: GPL-2.0-only
22

3-
obj-$(CONFIG_FB) += fbdev.o
3+
obj-$(CONFIG_FB_CORE) += fbdev.o

drivers/accel/ivpu/ivpu_hw_40xx.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
#define SKU_HW_ID_SHIFT 16u
2525
#define SKU_HW_ID_MASK 0xffff0000u
2626

27-
#define PLL_CONFIG_DEFAULT 0x1
27+
#define PLL_CONFIG_DEFAULT 0x0
2828
#define PLL_CDYN_DEFAULT 0x80
2929
#define PLL_EPP_DEFAULT 0x80
3030
#define PLL_REF_CLK_FREQ (50 * 1000000)

drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1528,6 +1528,9 @@ bool amdgpu_acpi_is_s0ix_active(struct amdgpu_device *adev)
15281528
*/
15291529
void amdgpu_choose_low_power_state(struct amdgpu_device *adev)
15301530
{
1531+
if (adev->in_runpm)
1532+
return;
1533+
15311534
if (amdgpu_acpi_is_s0ix_active(adev))
15321535
adev->in_s0ix = true;
15331536
else if (amdgpu_acpi_is_s3_active(adev))

drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c

Lines changed: 34 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1843,21 +1843,12 @@ static int amdgpu_dm_init(struct amdgpu_device *adev)
18431843
DRM_ERROR("amdgpu: fail to register dmub aux callback");
18441844
goto error;
18451845
}
1846-
if (!register_dmub_notify_callback(adev, DMUB_NOTIFICATION_HPD, dmub_hpd_callback, true)) {
1847-
DRM_ERROR("amdgpu: fail to register dmub hpd callback");
1848-
goto error;
1849-
}
1850-
if (!register_dmub_notify_callback(adev, DMUB_NOTIFICATION_HPD_IRQ, dmub_hpd_callback, true)) {
1851-
DRM_ERROR("amdgpu: fail to register dmub hpd callback");
1852-
goto error;
1853-
}
1854-
}
1855-
1856-
/* Enable outbox notification only after IRQ handlers are registered and DMUB is alive.
1857-
* It is expected that DMUB will resend any pending notifications at this point, for
1858-
* example HPD from DPIA.
1859-
*/
1860-
if (dc_is_dmub_outbox_supported(adev->dm.dc)) {
1846+
/* Enable outbox notification only after IRQ handlers are registered and DMUB is alive.
1847+
* It is expected that DMUB will resend any pending notifications at this point. Note
1848+
* that hpd and hpd_irq handler registration are deferred to register_hpd_handlers() to
1849+
* align legacy interface initialization sequence. Connection status will be proactivly
1850+
* detected once in the amdgpu_dm_initialize_drm_device.
1851+
*/
18611852
dc_enable_dmub_outbox(adev->dm.dc);
18621853

18631854
/* DPIA trace goes to dmesg logs only if outbox is enabled */
@@ -2287,6 +2278,7 @@ static int dm_sw_fini(void *handle)
22872278

22882279
if (adev->dm.dmub_srv) {
22892280
dmub_srv_destroy(adev->dm.dmub_srv);
2281+
kfree(adev->dm.dmub_srv);
22902282
adev->dm.dmub_srv = NULL;
22912283
}
22922284

@@ -3536,6 +3528,14 @@ static void register_hpd_handlers(struct amdgpu_device *adev)
35363528
int_params.requested_polarity = INTERRUPT_POLARITY_DEFAULT;
35373529
int_params.current_polarity = INTERRUPT_POLARITY_DEFAULT;
35383530

3531+
if (dc_is_dmub_outbox_supported(adev->dm.dc)) {
3532+
if (!register_dmub_notify_callback(adev, DMUB_NOTIFICATION_HPD, dmub_hpd_callback, true))
3533+
DRM_ERROR("amdgpu: fail to register dmub hpd callback");
3534+
3535+
if (!register_dmub_notify_callback(adev, DMUB_NOTIFICATION_HPD_IRQ, dmub_hpd_callback, true))
3536+
DRM_ERROR("amdgpu: fail to register dmub hpd callback");
3537+
}
3538+
35393539
list_for_each_entry(connector,
35403540
&dev->mode_config.connector_list, head) {
35413541

@@ -3564,10 +3564,6 @@ static void register_hpd_handlers(struct amdgpu_device *adev)
35643564
handle_hpd_rx_irq,
35653565
(void *) aconnector);
35663566
}
3567-
3568-
if (adev->dm.hpd_rx_offload_wq)
3569-
adev->dm.hpd_rx_offload_wq[connector->index].aconnector =
3570-
aconnector;
35713567
}
35723568
}
35733569

@@ -4561,6 +4557,10 @@ static int amdgpu_dm_initialize_drm_device(struct amdgpu_device *adev)
45614557
goto fail;
45624558
}
45634559

4560+
if (dm->hpd_rx_offload_wq)
4561+
dm->hpd_rx_offload_wq[aconnector->base.index].aconnector =
4562+
aconnector;
4563+
45644564
if (!dc_link_detect_connection_type(link, &new_connection_type))
45654565
DRM_ERROR("KMS: Failed to detect connector\n");
45664566

@@ -6534,18 +6534,23 @@ amdgpu_dm_connector_late_register(struct drm_connector *connector)
65346534
static void amdgpu_dm_connector_funcs_force(struct drm_connector *connector)
65356535
{
65366536
struct amdgpu_dm_connector *aconnector = to_amdgpu_dm_connector(connector);
6537-
struct amdgpu_connector *amdgpu_connector = to_amdgpu_connector(connector);
65386537
struct dc_link *dc_link = aconnector->dc_link;
65396538
struct dc_sink *dc_em_sink = aconnector->dc_em_sink;
65406539
struct edid *edid;
6540+
struct i2c_adapter *ddc;
6541+
6542+
if (dc_link->aux_mode)
6543+
ddc = &aconnector->dm_dp_aux.aux.ddc;
6544+
else
6545+
ddc = &aconnector->i2c->base;
65416546

65426547
/*
65436548
* Note: drm_get_edid gets edid in the following order:
65446549
* 1) override EDID if set via edid_override debugfs,
65456550
* 2) firmware EDID if set via edid_firmware module parameter
65466551
* 3) regular DDC read.
65476552
*/
6548-
edid = drm_get_edid(connector, &amdgpu_connector->ddc_bus->aux.ddc);
6553+
edid = drm_get_edid(connector, ddc);
65496554
if (!edid) {
65506555
DRM_ERROR("No EDID found on connector: %s.\n", connector->name);
65516556
return;
@@ -6586,20 +6591,26 @@ static int get_modes(struct drm_connector *connector)
65866591
static void create_eml_sink(struct amdgpu_dm_connector *aconnector)
65876592
{
65886593
struct drm_connector *connector = &aconnector->base;
6589-
struct amdgpu_connector *amdgpu_connector = to_amdgpu_connector(&aconnector->base);
6594+
struct dc_link *dc_link = aconnector->dc_link;
65906595
struct dc_sink_init_data init_params = {
65916596
.link = aconnector->dc_link,
65926597
.sink_signal = SIGNAL_TYPE_VIRTUAL
65936598
};
65946599
struct edid *edid;
6600+
struct i2c_adapter *ddc;
6601+
6602+
if (dc_link->aux_mode)
6603+
ddc = &aconnector->dm_dp_aux.aux.ddc;
6604+
else
6605+
ddc = &aconnector->i2c->base;
65956606

65966607
/*
65976608
* Note: drm_get_edid gets edid in the following order:
65986609
* 1) override EDID if set via edid_override debugfs,
65996610
* 2) firmware EDID if set via edid_firmware module parameter
66006611
* 3) regular DDC read.
66016612
*/
6602-
edid = drm_get_edid(connector, &amdgpu_connector->ddc_bus->aux.ddc);
6613+
edid = drm_get_edid(connector, ddc);
66036614
if (!edid) {
66046615
DRM_ERROR("No EDID found on connector: %s.\n", connector->name);
66056616
return;

drivers/gpu/drm/amd/display/dc/dc_dmub_srv.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,14 +125,15 @@ bool dc_dmub_srv_cmd_list_queue_execute(struct dc_dmub_srv *dc_dmub_srv,
125125
unsigned int count,
126126
union dmub_rb_cmd *cmd_list)
127127
{
128-
struct dc_context *dc_ctx = dc_dmub_srv->ctx;
128+
struct dc_context *dc_ctx;
129129
struct dmub_srv *dmub;
130130
enum dmub_status status;
131131
int i;
132132

133133
if (!dc_dmub_srv || !dc_dmub_srv->dmub)
134134
return false;
135135

136+
dc_ctx = dc_dmub_srv->ctx;
136137
dmub = dc_dmub_srv->dmub;
137138

138139
for (i = 0 ; i < count; i++) {
@@ -1161,7 +1162,7 @@ void dc_dmub_srv_subvp_save_surf_addr(const struct dc_dmub_srv *dc_dmub_srv, con
11611162

11621163
bool dc_dmub_srv_is_hw_pwr_up(struct dc_dmub_srv *dc_dmub_srv, bool wait)
11631164
{
1164-
struct dc_context *dc_ctx = dc_dmub_srv->ctx;
1165+
struct dc_context *dc_ctx;
11651166
enum dmub_status status;
11661167

11671168
if (!dc_dmub_srv || !dc_dmub_srv->dmub)
@@ -1170,6 +1171,8 @@ bool dc_dmub_srv_is_hw_pwr_up(struct dc_dmub_srv *dc_dmub_srv, bool wait)
11701171
if (dc_dmub_srv->ctx->dc->debug.dmcub_emulation)
11711172
return true;
11721173

1174+
dc_ctx = dc_dmub_srv->ctx;
1175+
11731176
if (wait) {
11741177
if (dc_dmub_srv->ctx->dc->debug.disable_timeout) {
11751178
do {

drivers/gpu/drm/amd/display/dc/dce/dce_panel_cntl.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -290,4 +290,5 @@ void dce_panel_cntl_construct(
290290
dce_panel_cntl->base.funcs = &dce_link_panel_cntl_funcs;
291291
dce_panel_cntl->base.ctx = init_data->ctx;
292292
dce_panel_cntl->base.inst = init_data->inst;
293+
dce_panel_cntl->base.pwrseq_inst = 0;
293294
}

drivers/gpu/drm/amd/display/dc/dcn301/dcn301_panel_cntl.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -215,4 +215,5 @@ void dcn301_panel_cntl_construct(
215215
dcn301_panel_cntl->base.funcs = &dcn301_link_panel_cntl_funcs;
216216
dcn301_panel_cntl->base.ctx = init_data->ctx;
217217
dcn301_panel_cntl->base.inst = init_data->inst;
218+
dcn301_panel_cntl->base.pwrseq_inst = 0;
218219
}

drivers/gpu/drm/amd/display/dc/dcn31/dcn31_panel_cntl.c

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,8 +154,24 @@ void dcn31_panel_cntl_construct(
154154
struct dcn31_panel_cntl *dcn31_panel_cntl,
155155
const struct panel_cntl_init_data *init_data)
156156
{
157+
uint8_t pwrseq_inst = 0xF;
158+
157159
dcn31_panel_cntl->base.funcs = &dcn31_link_panel_cntl_funcs;
158160
dcn31_panel_cntl->base.ctx = init_data->ctx;
159161
dcn31_panel_cntl->base.inst = init_data->inst;
160-
dcn31_panel_cntl->base.pwrseq_inst = init_data->pwrseq_inst;
162+
163+
switch (init_data->eng_id) {
164+
case ENGINE_ID_DIGA:
165+
pwrseq_inst = 0;
166+
break;
167+
case ENGINE_ID_DIGB:
168+
pwrseq_inst = 1;
169+
break;
170+
default:
171+
DC_LOG_WARNING("Unsupported pwrseq engine id: %d!\n", init_data->eng_id);
172+
ASSERT(false);
173+
break;
174+
}
175+
176+
dcn31_panel_cntl->base.pwrseq_inst = pwrseq_inst;
161177
}

drivers/gpu/drm/amd/display/dc/dml2/dml2_translation_helper.c

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -398,7 +398,6 @@ void dml2_init_soc_states(struct dml2_context *dml2, const struct dc *in_dc,
398398
/* Copy clocks tables entries, if available */
399399
if (dml2->config.bbox_overrides.clks_table.num_states) {
400400
p->in_states->num_states = dml2->config.bbox_overrides.clks_table.num_states;
401-
402401
for (i = 0; i < dml2->config.bbox_overrides.clks_table.num_entries_per_clk.num_dcfclk_levels; i++) {
403402
p->in_states->state_array[i].dcfclk_mhz = dml2->config.bbox_overrides.clks_table.clk_entries[i].dcfclk_mhz;
404403
}
@@ -437,6 +436,14 @@ void dml2_init_soc_states(struct dml2_context *dml2, const struct dc *in_dc,
437436
}
438437

439438
dml2_policy_build_synthetic_soc_states(s, p);
439+
if (dml2->v20.dml_core_ctx.project == dml_project_dcn35 ||
440+
dml2->v20.dml_core_ctx.project == dml_project_dcn351) {
441+
// Override last out_state with data from last in_state
442+
// This will ensure that out_state contains max fclk
443+
memcpy(&p->out_states->state_array[p->out_states->num_states - 1],
444+
&p->in_states->state_array[p->in_states->num_states - 1],
445+
sizeof(struct soc_state_bounding_box_st));
446+
}
440447
}
441448

442449
void dml2_translate_ip_params(const struct dc *in, struct ip_params_st *out)

0 commit comments

Comments
 (0)