Skip to contentSkip to conversation

Revert "drm/amd/display: Add null check for 'afb' in amdgpu_dm_update_cursor"

PATCH In review [email protected] 3 participants 6 messages Jun 7, 2024

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

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

From: Ivan Lipski <[email protected]>

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

This reverts commit 14bcf29b706f8ef423b86c9b783055b5b0c2cd35.

---
 .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c    | 16 ++++------------
 1 file changed, 4 insertions(+), 12 deletions(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +4 -12
index 27acbe3ff57b..448932ac06fb 100644
@@ -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;
 
Signature · 1 line
2.34.1
#1 lore raw

PATCH 2/2 Revert "drm/amd/display: Add NULL check for 'afb' before dereferencing in amdgpu_dm_plane_handle_cursor_update"

From: Ivan Lipski <[email protected]>

[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.

---
 .../drm/amd/display/amdgpu_dm/amdgpu_dm_plane.c  | 16 ++++------------
 1 file changed, 4 insertions(+), 12 deletions(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_plane.c +4 -12
index b339642b86c0..a64f20fcddaa 100644
@@ -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;
 
Signature · 1 line
2.34.1
Reviewed-by Srinivasan Shanmugam on v1 2/2
#2 lore raw

Re: [PATCH 2/2] Revert "drm/amd/display: Add NULL check for 'afb' before dereferencing in amdgpu_dm_plane_handle_cursor_update"

[AMD Official Use Only - AMD Internal Distribution Only]

Get Outlook for Android<https://aka.ms/AAb9ysg>
________________________________
From: LIPSKI, IVAN <[email protected]>
Sent: Friday, June 7, 2024 10:03:59 PM
To: [email protected] <[email protected]>
Cc: SHANMUGAM, SRINIVASAN <[email protected]>; Li, Sun peng (Leo) <[email protected]>; Wentland, Harry <[email protected]>; Siqueira, Rodrigo <[email protected]>; Choi, Nicholas <[email protected]>; Zhang, George <[email protected]>; [email protected] <[email protected]>; LIPSKI, IVAN <[email protected]>
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 <[email protected]>

[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.

---
 .../drm/amd/display/amdgpu_dm/amdgpu_dm_plane.c  | 16 ++++------------
 1 file changed, 4 insertions(+), 12 deletions(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_plane.c +4 -12
index b339642b86c0..a64f20fcddaa 100644
@@ -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

Tested-by on v1 2/2
#3 lore raw

RE: [PATCH 2/2] Revert "drm/amd/display: Add NULL check for 'afb' before dereferencing in amdgpu_dm_plane_handle_cursor_update"

In reply to [email protected]

[AMD Official Use Only - AMD Internal Distribution Only]

Thanks,
George

-----Original Message-----
From: LIPSKI, IVAN <[email protected]>
Sent: Friday, June 7, 2024 12:34 PM
To: [email protected]
Cc: SHANMUGAM, SRINIVASAN <[email protected]>; Li, Sun peng (Leo) <[email protected]>; Wentland, Harry <[email protected]>; Siqueira, Rodrigo <[email protected]>; Choi, Nicholas <[email protected]>; Zhang, George <[email protected]>; [email protected]; LIPSKI, IVAN <[email protected]>
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 <[email protected]>

[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.

---
 .../drm/amd/display/amdgpu_dm/amdgpu_dm_plane.c  | 16 ++++------------
 1 file changed, 4 insertions(+), 12 deletions(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_plane.c +4 -12
index b339642b86c0..a64f20fcddaa 100644
@@ -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

Reviewed-by Srinivasan Shanmugam on v1 1/2
#4 lore raw
In reply to [email protected]

[AMD Official Use Only - AMD Internal Distribution Only]

Get Outlook for Android<https://aka.ms/AAb9ysg>
________________________________
From: LIPSKI, IVAN <[email protected]>
Sent: Friday, June 7, 2024 10:03:58 PM
To: [email protected] <[email protected]>
Cc: SHANMUGAM, SRINIVASAN <[email protected]>; Li, Sun peng (Leo) <[email protected]>; Wentland, Harry <[email protected]>; Siqueira, Rodrigo <[email protected]>; Choi, Nicholas <[email protected]>; Zhang, George <[email protected]>; [email protected] <[email protected]>; LIPSKI, IVAN <[email protected]>
Subject: [PATCH 1/2] Revert "drm/amd/display: Add null check for 'afb' in amdgpu_dm_update_cursor"

From: Ivan Lipski <[email protected]>

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

This reverts commit 14bcf29b706f8ef423b86c9b783055b5b0c2cd35.

---
 .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c    | 16 ++++------------
 1 file changed, 4 insertions(+), 12 deletions(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +4 -12
index 27acbe3ff57b..448932ac06fb 100644
@@ -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

Tested-by on v1 1/2
#5 lore raw
In reply to [email protected]

[AMD Official Use Only - AMD Internal Distribution Only]

Thanks,
George

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

From: Ivan Lipski <[email protected]>

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

This reverts commit 14bcf29b706f8ef423b86c9b783055b5b0c2cd35.

---
 .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c    | 16 ++++------------
 1 file changed, 4 insertions(+), 12 deletions(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +4 -12
index 27acbe3ff57b..448932ac06fb 100644
@@ -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