Skip to content

Commit 95d168b

Browse files
Ivan Lipskialexdeucher
authored andcommitted
drm/amd/display: Allow RX6xxx & RX7700 to invoke amdgpu_irq_get/put
[Why&How] As reported on https://gitlab.freedesktop.org/drm/amd/-/issues/3936, SMU hang can occur if the interrupts are not enabled appropriately, causing a vblank timeout. This patch reverts commit 5009628 ("drm/amd/display: Remove unnecessary amdgpu_irq_get/put"), but only for RX6xxx & RX7700 GPUs, on which the issue was observed. This will re-enable interrupts regardless of whether the user space needed it or not. Fixes: 5009628 ("drm/amd/display: Remove unnecessary amdgpu_irq_get/put") Closes: https://gitlab.freedesktop.org/drm/amd/-/issues/3936 Suggested-by: Sun peng Li <sunpeng.li@amd.com> Reviewed-by: Sun peng Li <sunpeng.li@amd.com> Signed-off-by: Ivan Lipski <ivan.lipski@amd.com> Signed-off-by: Ray Wu <ray.wu@amd.com> Tested-by: Daniel Wheeler <daniel.wheeler@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
1 parent 782f0bb commit 95d168b

File tree

1 file changed

+38
-1
lines changed

1 file changed

+38
-1
lines changed

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

Lines changed: 38 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8796,7 +8796,16 @@ static int amdgpu_dm_encoder_init(struct drm_device *dev,
87968796
static void manage_dm_interrupts(struct amdgpu_device *adev,
87978797
struct amdgpu_crtc *acrtc,
87988798
struct dm_crtc_state *acrtc_state)
8799-
{
8799+
{ /*
8800+
* We cannot be sure that the frontend index maps to the same
8801+
* backend index - some even map to more than one.
8802+
* So we have to go through the CRTC to find the right IRQ.
8803+
*/
8804+
int irq_type = amdgpu_display_crtc_idx_to_irq_type(
8805+
adev,
8806+
acrtc->crtc_id);
8807+
struct drm_device *dev = adev_to_drm(adev);
8808+
88008809
struct drm_vblank_crtc_config config = {0};
88018810
struct dc_crtc_timing *timing;
88028811
int offdelay;
@@ -8849,7 +8858,35 @@ static void manage_dm_interrupts(struct amdgpu_device *adev,
88498858

88508859
drm_crtc_vblank_on_config(&acrtc->base,
88518860
&config);
8861+
/* Allow RX6xxx, RX7700, RX7800 GPUs to call amdgpu_irq_get.*/
8862+
switch (amdgpu_ip_version(adev, DCE_HWIP, 0)) {
8863+
case IP_VERSION(3, 0, 0):
8864+
case IP_VERSION(3, 0, 2):
8865+
case IP_VERSION(3, 0, 3):
8866+
case IP_VERSION(3, 2, 0):
8867+
if (amdgpu_irq_get(adev, &adev->pageflip_irq, irq_type))
8868+
drm_err(dev, "DM_IRQ: Cannot get pageflip irq!\n");
8869+
#if defined(CONFIG_DRM_AMD_SECURE_DISPLAY)
8870+
if (amdgpu_irq_get(adev, &adev->vline0_irq, irq_type))
8871+
drm_err(dev, "DM_IRQ: Cannot get vline0 irq!\n");
8872+
#endif
8873+
}
8874+
88528875
} else {
8876+
/* Allow RX6xxx, RX7700, RX7800 GPUs to call amdgpu_irq_put.*/
8877+
switch (amdgpu_ip_version(adev, DCE_HWIP, 0)) {
8878+
case IP_VERSION(3, 0, 0):
8879+
case IP_VERSION(3, 0, 2):
8880+
case IP_VERSION(3, 0, 3):
8881+
case IP_VERSION(3, 2, 0):
8882+
#if defined(CONFIG_DRM_AMD_SECURE_DISPLAY)
8883+
if (amdgpu_irq_put(adev, &adev->vline0_irq, irq_type))
8884+
drm_err(dev, "DM_IRQ: Cannot put vline0 irq!\n");
8885+
#endif
8886+
if (amdgpu_irq_put(adev, &adev->pageflip_irq, irq_type))
8887+
drm_err(dev, "DM_IRQ: Cannot put pageflip irq!\n");
8888+
}
8889+
88538890
drm_crtc_vblank_off(&acrtc->base);
88548891
}
88558892
}

0 commit comments

Comments
 (0)