Skip to content

Commit 2d4bd81

Browse files
Stylon Wangalexdeucher
authored andcommitted
drm/amd/display: Fix new dmub notification enabling in DM
[Why] Changes from "Fix for dmub outbox notification enable" need to land in DM or DMUB outbox notification would be disabled. [How] Enable outbox notification only after interrupt are enabled and IRQ handlers registered. Any pending notification will be sent by DMUB once outbox notification is enabled. Fixes: ed72087 ("drm/amd/display: Fix for dmub outbox notification enable") Reviewed-by: Nicholas Kazlauskas <[email protected]> Acked-by: Solomon Chiu <[email protected]> Signed-off-by: Stylon Wang <[email protected]> Acked-by: Harry Wentland <[email protected]> Signed-off-by: Alex Deucher <[email protected]> Cc: [email protected]
1 parent 3283c83 commit 2d4bd81

File tree

1 file changed

+19
-8
lines changed

1 file changed

+19
-8
lines changed

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

Lines changed: 19 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1653,7 +1653,7 @@ static int amdgpu_dm_init(struct amdgpu_device *adev)
16531653
#if defined(CONFIG_DRM_AMD_SECURE_DISPLAY)
16541654
adev->dm.crc_rd_wrk = amdgpu_dm_crtc_secure_display_create_work();
16551655
#endif
1656-
if (dc_enable_dmub_notifications(adev->dm.dc)) {
1656+
if (dc_is_dmub_outbox_supported(adev->dm.dc)) {
16571657
init_completion(&adev->dm.dmub_aux_transfer_done);
16581658
adev->dm.dmub_notify = kzalloc(sizeof(struct dmub_notification), GFP_KERNEL);
16591659
if (!adev->dm.dmub_notify) {
@@ -1689,6 +1689,13 @@ static int amdgpu_dm_init(struct amdgpu_device *adev)
16891689
goto error;
16901690
}
16911691

1692+
/* Enable outbox notification only after IRQ handlers are registered and DMUB is alive.
1693+
* It is expected that DMUB will resend any pending notifications at this point, for
1694+
* example HPD from DPIA.
1695+
*/
1696+
if (dc_is_dmub_outbox_supported(adev->dm.dc))
1697+
dc_enable_dmub_outbox(adev->dm.dc);
1698+
16921699
/* create fake encoders for MST */
16931700
dm_dp_create_fake_mst_encoders(adev);
16941701

@@ -2678,9 +2685,6 @@ static int dm_resume(void *handle)
26782685
*/
26792686
link_enc_cfg_copy(adev->dm.dc->current_state, dc_state);
26802687

2681-
if (dc_enable_dmub_notifications(adev->dm.dc))
2682-
amdgpu_dm_outbox_init(adev);
2683-
26842688
r = dm_dmub_hw_init(adev);
26852689
if (r)
26862690
DRM_ERROR("DMUB interface failed to initialize: status=%d\n", r);
@@ -2698,6 +2702,11 @@ static int dm_resume(void *handle)
26982702
}
26992703
}
27002704

2705+
if (dc_is_dmub_outbox_supported(adev->dm.dc)) {
2706+
amdgpu_dm_outbox_init(adev);
2707+
dc_enable_dmub_outbox(adev->dm.dc);
2708+
}
2709+
27012710
WARN_ON(!dc_commit_state(dm->dc, dc_state));
27022711

27032712
dm_gpureset_commit_state(dm->cached_dc_state, dm);
@@ -2719,13 +2728,15 @@ static int dm_resume(void *handle)
27192728
/* TODO: Remove dc_state->dccg, use dc->dccg directly. */
27202729
dc_resource_state_construct(dm->dc, dm_state->context);
27212730

2722-
/* Re-enable outbox interrupts for DPIA. */
2723-
if (dc_enable_dmub_notifications(adev->dm.dc))
2724-
amdgpu_dm_outbox_init(adev);
2725-
27262731
/* Before powering on DC we need to re-initialize DMUB. */
27272732
dm_dmub_hw_resume(adev);
27282733

2734+
/* Re-enable outbox interrupts for DPIA. */
2735+
if (dc_is_dmub_outbox_supported(adev->dm.dc)) {
2736+
amdgpu_dm_outbox_init(adev);
2737+
dc_enable_dmub_outbox(adev->dm.dc);
2738+
}
2739+
27292740
/* power on hardware */
27302741
dc_set_power_state(dm->dc, DC_ACPI_CM_POWER_STATE_D0);
27312742

0 commit comments

Comments
 (0)