[AMD Official Use Only - AMD Internal Distribution Only]
From: LIPSKI, IVAN <IVAN.LIPSKI@xxxxxxx>
Sent: Friday, June 7, 2024 10:03:59 PM
To: amd-gfx@xxxxxxxxxxxxxxxxxxxxx <amd-gfx@xxxxxxxxxxxxxxxxxxxxx>
Cc: SHANMUGAM, SRINIVASAN <SRINIVASAN.SHANMUGAM@xxxxxxx>; Li, Sun peng (Leo) <Sunpeng.Li@xxxxxxx>; Wentland, Harry <Harry.Wentland@xxxxxxx>; Siqueira, Rodrigo <Rodrigo.Siqueira@xxxxxxx>; Choi, Nicholas <Nicholas.Choi@xxxxxxx>; Zhang, George <George.Zhang@xxxxxxx>; alex.deucher@xxxxxxx <alex.deucher@xxxxxxx>; LIPSKI, IVAN <IVAN.LIPSKI@xxxxxxx>
Subject: [PATCH 2/2] Revert "drm/amd/display: Add NULL check for 'afb' before dereferencing in amdgpu_dm_plane_handle_cursor_update"
Sent: Friday, June 7, 2024 10:03:59 PM
To: amd-gfx@xxxxxxxxxxxxxxxxxxxxx <amd-gfx@xxxxxxxxxxxxxxxxxxxxx>
Cc: SHANMUGAM, SRINIVASAN <SRINIVASAN.SHANMUGAM@xxxxxxx>; Li, Sun peng (Leo) <Sunpeng.Li@xxxxxxx>; Wentland, Harry <Harry.Wentland@xxxxxxx>; Siqueira, Rodrigo <Rodrigo.Siqueira@xxxxxxx>; Choi, Nicholas <Nicholas.Choi@xxxxxxx>; Zhang, George <George.Zhang@xxxxxxx>; alex.deucher@xxxxxxx <alex.deucher@xxxxxxx>; LIPSKI, IVAN <IVAN.LIPSKI@xxxxxxx>
Subject: [PATCH 2/2] Revert "drm/amd/display: Add NULL check for 'afb' before dereferencing in amdgpu_dm_plane_handle_cursor_update"
From: Ivan Lipski <ivlipski@xxxxxxx>
[WHY]
This patch is a dupplicate implementation of 14bcf29b, which we
are reverting due to a regression with kms_plane_cursor IGT tests.
This reverts commit 0d84450ae0db367780c3dd2e208fe4e6fe5565b8.
Signed-off-by: Ivan Lipski <ivlipski@xxxxxxx>
---
.../drm/amd/display/amdgpu_dm/amdgpu_dm_plane.c | 16 ++++------------
1 file changed, 4 insertions(+), 12 deletions(-)
diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_plane.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_plane.c
index b339642b86c0..a64f20fcddaa 100644
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_plane.c
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_plane.c
@@ -1246,22 +1246,14 @@ void amdgpu_dm_plane_handle_cursor_update(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
[WHY]
This patch is a dupplicate implementation of 14bcf29b, which we
are reverting due to a regression with kms_plane_cursor IGT tests.
This reverts commit 0d84450ae0db367780c3dd2e208fe4e6fe5565b8.
Signed-off-by: Ivan Lipski <ivlipski@xxxxxxx>
---
.../drm/amd/display/amdgpu_dm/amdgpu_dm_plane.c | 16 ++++------------
1 file changed, 4 insertions(+), 12 deletions(-)
diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_plane.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_plane.c
index b339642b86c0..a64f20fcddaa 100644
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_plane.c
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_plane.c
@@ -1246,22 +1246,14 @@ void amdgpu_dm_plane_handle_cursor_update(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