Skip to contentSkip to conversation

Revert "drm/amd/display: Remove unnecessary amdgpu_irq_get/put"

PATCH In review Alex Deucher 2 participants 2 messages Sep 8, 2025 – Sep 9, 2025

Subsystems (3)
lore
Share & tools
lore

Alex Deucher

author maintainer
#0 lore raw

PATCH 1/1 Revert "drm/amd/display: Remove unnecessary amdgpu_irq_get/put"

This reverts commit 3782305ce5807c18fbf092124b9e8303cf1723ae.

This commit breaks init on some boards so revert for now.

---
 .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 31 +++++++++++++++++++
 1 file changed, 31 insertions(+)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +31 -0
index 611a935890571..f1ff0f95a719f 100644
@@ -8797,6 +8797,16 @@ static void manage_dm_interrupts(struct amdgpu_device *adev,
 				 struct amdgpu_crtc *acrtc,
 				 struct dm_crtc_state *acrtc_state)
 {
+	/*
+	 * We have no guarantee that the frontend index maps to the same
+	 * backend index - some even map to more than one.
+	 *
+	 * TODO: Use a different interrupt or check DC itself for the mapping.
+	 */
+	int irq_type =
+		amdgpu_display_crtc_idx_to_irq_type(
+			adev,
+			acrtc->crtc_id);
 	struct drm_vblank_crtc_config config = {0};
 	struct dc_crtc_timing *timing;
 	int offdelay;
@@ -8849,7 +8859,28 @@ static void manage_dm_interrupts(struct amdgpu_device *adev,
 
 		drm_crtc_vblank_on_config(&acrtc->base,
 					  &config);
+
+		amdgpu_irq_get(
+			adev,
+			&adev->pageflip_irq,
+			irq_type);
+#if defined(CONFIG_DRM_AMD_SECURE_DISPLAY)
+		amdgpu_irq_get(
+			adev,
+			&adev->vline0_irq,
+			irq_type);
+#endif
 	} else {
+#if defined(CONFIG_DRM_AMD_SECURE_DISPLAY)
+		amdgpu_irq_put(
+			adev,
+			&adev->vline0_irq,
+			irq_type);
+#endif
+		amdgpu_irq_put(
+			adev,
+			&adev->pageflip_irq,
+			irq_type);
 		drm_crtc_vblank_off(&acrtc->base);
 	}
 }
Signature · 1 line
2.51.0
#1 lore raw

Hi Alex,

There is a similar patch pending for this week's promotion but specific for RX6xxx & RX7700: "drm/amd/display: Allow RX6xxx & RX7700 to invoke amdgpu_irq_get/put".

It should be public in two days.

Cheers,
Alex H.

Quoted 63 lines · Alex Deucher

This reverts commit 3782305ce5807c18fbf092124b9e8303cf1723ae.

This commit breaks init on some boards so revert for now.

---
  .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 31 +++++++++++++++++++
  1 file changed, 31 insertions(+)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +31 -0
index 611a935890571..f1ff0f95a719f 100644
@@ -8797,6 +8797,16 @@ static void manage_dm_interrupts(struct amdgpu_device *adev,
  				 struct amdgpu_crtc *acrtc,
  				 struct dm_crtc_state *acrtc_state)
  {
+	/*
+	 * We have no guarantee that the frontend index maps to the same
+	 * backend index - some even map to more than one.
+	 *
+	 * TODO: Use a different interrupt or check DC itself for the mapping.
+	 */
+	int irq_type =
+		amdgpu_display_crtc_idx_to_irq_type(
+			adev,
+			acrtc->crtc_id);
  	struct drm_vblank_crtc_config config = {0};
  	struct dc_crtc_timing *timing;
  	int offdelay;
@@ -8849,7 +8859,28 @@ static void manage_dm_interrupts(struct amdgpu_device *adev,
 
  		drm_crtc_vblank_on_config(&acrtc->base,
  					  &config);
+
+		amdgpu_irq_get(
+			adev,
+			&adev->pageflip_irq,
+			irq_type);
+#if defined(CONFIG_DRM_AMD_SECURE_DISPLAY)
+		amdgpu_irq_get(
+			adev,
+			&adev->vline0_irq,
+			irq_type);
+#endif
  	} else {
+#if defined(CONFIG_DRM_AMD_SECURE_DISPLAY)
+		amdgpu_irq_put(
+			adev,
+			&adev->vline0_irq,
+			irq_type);
+#endif
+		amdgpu_irq_put(
+			adev,
+			&adev->pageflip_irq,
+			irq_type);
  		drm_crtc_vblank_off(&acrtc->base);
  	}
  }