[PATCH 12/22] drm/amd/display: fix incorrect return of vblank enable on unconfigured crtc

Zaeem Mohamed zaeem.mohamed at amd.com
Tue Apr 15 14:58:58 UTC 2025


From: Aurabindo Pillai <aurabindo.pillai at amd.com>

When userspace asks us to enable vblank on a crtc that is not yet
enabled return -EINVAL. There is no need to queue the vblank handler in
this case, so return early.

Closes: https://gitlab.freedesktop.org/drm/amd/-/issues/1856

Reviewed-by: Sun peng Li <sunpeng.li at amd.com>
Signed-off-by: Aurabindo Pillai <aurabindo.pillai at amd.com>
Signed-off-by: Zaeem Mohamed <zaeem.mohamed at amd.com>
---
 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_crtc.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_crtc.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_crtc.c
index e8bdd7f0c460..22d9ded489af 100644
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_crtc.c
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_crtc.c
@@ -302,8 +302,8 @@ static inline int amdgpu_dm_crtc_set_vblank(struct drm_crtc *crtc, bool enable)
 	int irq_type;
 	int rc = 0;
 
-	if (acrtc->otg_inst == -1)
-		goto skip;
+	if (!acrtc->base.enabled)
+		return -EINVAL;
 
 	irq_type = amdgpu_display_crtc_idx_to_irq_type(adev, acrtc->crtc_id);
 
@@ -365,7 +365,6 @@ static inline int amdgpu_dm_crtc_set_vblank(struct drm_crtc *crtc, bool enable)
 			return rc;
 	}
 #endif
-skip:
 	if (amdgpu_in_reset(adev))
 		return 0;
 
@@ -752,4 +751,3 @@ int amdgpu_dm_crtc_init(struct amdgpu_display_manager *dm,
 	kfree(cursor_plane);
 	return res;
 }
-
-- 
2.34.1



More information about the amd-gfx mailing list