Skip to contentSkip to conversation

drm/amd/display: Set native cursor mode for disabled CRTCs again

PATCH Applied Timur Kristóf 3 participants 3 messages Aug 3 – Aug 5

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/amd/display: Set native cursor mode for disabled CRTCs again

It was regressed by a refactor. Let's fix it again.

Always set native cursor mode when the CRTC is disabled, to make sure it doesn't cause atomic commits to fail when they are trying to disable the CRTC.

Fixes 151164f96a4b ("drm/amd/display: add cursor module")
Cc Alex Hung <[email protected]>
---
 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_cursor.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_cursor.c +7 -2
index ab50d58896ab..d565433ea06d 100644
@@ -290,15 +290,20 @@ int amdgpu_dm_crtc_get_cursor_mode(struct amdgpu_device *adev,
 	/* Overlay cursor not supported on HW before DCN
 	 * DCN401/420 does not have the cursor-on-scaled-plane or cursor-on-yuv-plane restrictions
 	 * as previous DCN generations, so enable native mode on DCN401/420
+	 *
+	 * Always set native cursor mode when the CRTC is disabled,
+	 * to make sure it doesn't cause atomic commits to fail when
+	 * they are trying to disable the CRTC.
 	 */
 	if (amdgpu_ip_version(adev, DCE_HWIP, 0) == IP_VERSION(4, 0, 1) ||
 	    amdgpu_ip_version(adev, DCE_HWIP, 0) == IP_VERSION(4, 2, 0) ||
 #if defined(CONFIG_DRM_AMD_DC_DCN6_0)
 	    amdgpu_ip_version(adev, DCE_HWIP, 0) == IP_VERSION(4, 2, 1) ||
-	    amdgpu_ip_version(adev, DCE_HWIP, 0) == IP_VERSION(6, 0, 0)) {
+	    amdgpu_ip_version(adev, DCE_HWIP, 0) == IP_VERSION(6, 0, 0) ||
 #else
-	    amdgpu_ip_version(adev, DCE_HWIP, 0) == IP_VERSION(4, 2, 1)) {
+	    amdgpu_ip_version(adev, DCE_HWIP, 0) == IP_VERSION(4, 2, 1) ||
 #endif
+	    !dm_crtc_state->base.enable) {
 		*cursor_mode = DM_CURSOR_NATIVE_MODE;
 		return 0;
 	}
Signature · 1 line
2.55.0
Reviewed-by on v1 1/1
#1 lore raw
Quoted 5 lines · Timur Kristóf

It was regressed by a refactor. Let's fix it again.

Always set native cursor mode when the CRTC is disabled, to make sure it doesn't cause atomic commits to fail when they are trying to disable the CRTC.

Quoted 35 lines
Fixes 151164f96a4b ("drm/amd/display: add cursor module")
Cc Alex Hung <[email protected]>
---
  drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_cursor.c | 9 +++++++--
  1 file changed, 7 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_cursor.c +7 -2
index ab50d58896ab..d565433ea06d 100644
@@ -290,15 +290,20 @@ int amdgpu_dm_crtc_get_cursor_mode(struct amdgpu_device *adev,
  	/* Overlay cursor not supported on HW before DCN
  	 * DCN401/420 does not have the cursor-on-scaled-plane or cursor-on-yuv-plane restrictions
  	 * as previous DCN generations, so enable native mode on DCN401/420
+	 *
+	 * Always set native cursor mode when the CRTC is disabled,
+	 * to make sure it doesn't cause atomic commits to fail when
+	 * they are trying to disable the CRTC.
  	 */
  	if (amdgpu_ip_version(adev, DCE_HWIP, 0) == IP_VERSION(4, 0, 1) ||
  	    amdgpu_ip_version(adev, DCE_HWIP, 0) == IP_VERSION(4, 2, 0) ||
  #if defined(CONFIG_DRM_AMD_DC_DCN6_0)
  	    amdgpu_ip_version(adev, DCE_HWIP, 0) == IP_VERSION(4, 2, 1) ||
-	    amdgpu_ip_version(adev, DCE_HWIP, 0) == IP_VERSION(6, 0, 0)) {
+	    amdgpu_ip_version(adev, DCE_HWIP, 0) == IP_VERSION(6, 0, 0) ||
  #else
-	    amdgpu_ip_version(adev, DCE_HWIP, 0) == IP_VERSION(4, 2, 1)) {
+	    amdgpu_ip_version(adev, DCE_HWIP, 0) == IP_VERSION(4, 2, 1) ||
  #endif
+	    !dm_crtc_state->base.enable) {
  		*cursor_mode = DM_CURSOR_NATIVE_MODE;
  		return 0;
  	}
Signature · 2 lines
Thanks,
Ivan Lipski
Applied
#2 lore raw

Applied. Thanks!

Alex

Quoted 49 lines · Ivan Lipski
Quoted 5 lines · Timur Kristóf

It was regressed by a refactor. Let's fix it again.

Always set native cursor mode when the CRTC is disabled, to make sure it doesn't cause atomic commits to fail when they are trying to disable the CRTC.

Quoted 25 lines
Fixes 151164f96a4b ("drm/amd/display: add cursor module")
Cc Alex Hung <[email protected]>
---
  drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_cursor.c | 9 +++++++--
  1 file changed, 7 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_cursor.c +4 -0
index ab50d58896ab..d565433ea06d 100644
@@ -290,15 +290,20 @@ int amdgpu_dm_crtc_get_cursor_mode(struct amdgpu_device *adev,
      /* Overlay cursor not supported on HW before DCN
       * DCN401/420 does not have the cursor-on-scaled-plane or cursor-on-yuv-plane restrictions
       * as previous DCN generations, so enable native mode on DCN401/420
+      *
+      * Always set native cursor mode when the CRTC is disabled,
+      * to make sure it doesn't cause atomic commits to fail when
+      * they are trying to disable the CRTC.
       */
      if (amdgpu_ip_version(adev, DCE_HWIP, 0) == IP_VERSION(4, 0, 1) ||
          amdgpu_ip_version(adev, DCE_HWIP, 0) == IP_VERSION(4, 2, 0) ||
  #if defined(CONFIG_DRM_AMD_DC_DCN6_0)
          amdgpu_ip_version(adev, DCE_HWIP, 0) == IP_VERSION(4, 2, 1) ||

drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_cursor.c int amdgpu_dm_crtc_get_cursor_mode(struct amdgpu_device *adev, · line 309

Quoted 10 lines
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_cursor.c +3 -2
-         amdgpu_ip_version(adev, DCE_HWIP, 0) == IP_VERSION(6, 0, 0)) {
+         amdgpu_ip_version(adev, DCE_HWIP, 0) == IP_VERSION(6, 0, 0) ||
  #else
-         amdgpu_ip_version(adev, DCE_HWIP, 0) == IP_VERSION(4, 2, 1)) {
+         amdgpu_ip_version(adev, DCE_HWIP, 0) == IP_VERSION(4, 2, 1) ||
  #endif
+         !dm_crtc_state->base.enable) {
              *cursor_mode = DM_CURSOR_NATIVE_MODE;
              return 0;
      }

--
Thanks,
Ivan Lipski