[PATCH 1/2] Revert "drm/amd/display: Add null check for 'afb' in amdgpu_dm_update_cursor"

Zhang, George George.Zhang at amd.com
Fri Jun 7 17:35:50 UTC 2024


[AMD Official Use Only - AMD Internal Distribution Only]

Tested-by: George Zhang <George.zhang at amd.com>

Thanks,
George

-----Original Message-----
From: LIPSKI, IVAN <IVAN.LIPSKI at amd.com>
Sent: Friday, June 7, 2024 12:34 PM
To: amd-gfx at lists.freedesktop.org
Cc: SHANMUGAM, SRINIVASAN <SRINIVASAN.SHANMUGAM at amd.com>; Li, Sun peng (Leo) <Sunpeng.Li at amd.com>; Wentland, Harry <Harry.Wentland at amd.com>; Siqueira, Rodrigo <Rodrigo.Siqueira at amd.com>; Choi, Nicholas <Nicholas.Choi at amd.com>; Zhang, George <George.Zhang at amd.com>; alex.deucher at amd.com; LIPSKI, IVAN <IVAN.LIPSKI at amd.com>
Subject: [PATCH 1/2] Revert "drm/amd/display: Add null check for 'afb' in amdgpu_dm_update_cursor"

From: Ivan Lipski <ivlipski at amd.com>

[WHY]
This commit introduced a regression with kms_plane_cursor IGT
tests, causing AMD Asics to fail these tests.

This reverts commit 14bcf29b706f8ef423b86c9b783055b5b0c2cd35.

Signed-off-by: Ivan Lipski <ivlipski at amd.com>
---
 .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c    | 16 ++++------------
 1 file changed, 4 insertions(+), 12 deletions(-)

diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
index 27acbe3ff57b..448932ac06fb 100644
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
@@ -8637,22 +8637,14 @@ static void amdgpu_dm_update_cursor(struct drm_plane *plane,
 {
        struct amdgpu_device *adev = drm_to_adev(plane->dev);
        struct amdgpu_framebuffer *afb = to_amdgpu_framebuffer(plane->state->fb);
-       struct drm_crtc *crtc;
-       struct dm_crtc_state *crtc_state;
-       struct amdgpu_crtc *amdgpu_crtc;
-       u64 address;
+       struct drm_crtc *crtc = afb ? plane->state->crtc : old_plane_state->crtc;
+       struct dm_crtc_state *crtc_state = crtc ? to_dm_crtc_state(crtc->state) : NULL;
+       struct amdgpu_crtc *amdgpu_crtc = to_amdgpu_crtc(crtc);
+       uint64_t address = afb ? afb->address : 0;
        struct dc_cursor_position position = {0};
        struct dc_cursor_attributes attributes;
        int ret;

-       if (!afb)
-               return;
-
-       crtc = plane->state->crtc ? plane->state->crtc : old_plane_state->crtc;
-       crtc_state = crtc ? to_dm_crtc_state(crtc->state) : NULL;
-       amdgpu_crtc = to_amdgpu_crtc(crtc);
-       address = afb->address;
-
        if (!plane->state->fb && !old_plane_state->fb)
                return;

--
2.34.1



More information about the amd-gfx mailing list