AMD-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] Revert "drm/amd/display: Add null check for 'afb' in amdgpu_dm_update_cursor"
@ 2024-06-07 16:33 ivlipski
  0 siblings, 0 replies; 7+ messages in thread
From: ivlipski @ 2024-06-07 16:33 UTC (permalink / raw)
  To: amd-gfx
  Cc: sunpeng.li, harry.wentland, rodrigo.siqueira, nicholas.choi,
	george.zhang, alex.deucher, Ivan Lipski

From: Ivan Lipski <ivlipski@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@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


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH 1/2] Revert "drm/amd/display: Add null check for 'afb' in amdgpu_dm_update_cursor"
@ 2024-06-07 16:33 ivlipski
  2024-06-07 16:33 ` [PATCH 2/2] Revert "drm/amd/display: Add NULL check for 'afb' before dereferencing in amdgpu_dm_plane_handle_cursor_update" ivlipski
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: ivlipski @ 2024-06-07 16:33 UTC (permalink / raw)
  To: amd-gfx
  Cc: srinivasan.shanmugam, sunpeng.li, harry.wentland,
	rodrigo.siqueira, nicholas.choi, george.zhang, alex.deucher,
	Ivan Lipski

From: Ivan Lipski <ivlipski@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@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


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH 2/2] Revert "drm/amd/display: Add NULL check for 'afb' before dereferencing in amdgpu_dm_plane_handle_cursor_update"
  2024-06-07 16:33 [PATCH 1/2] Revert "drm/amd/display: Add null check for 'afb' in amdgpu_dm_update_cursor" ivlipski
@ 2024-06-07 16:33 ` ivlipski
  2024-06-07 16:49   ` SHANMUGAM, SRINIVASAN
  2024-06-07 17:36   ` Zhang, George
  2024-06-07 16:49 ` [PATCH 1/2] Revert "drm/amd/display: Add null check for 'afb' in amdgpu_dm_update_cursor" SHANMUGAM, SRINIVASAN
  2024-06-07 17:35 ` Zhang, George
  2 siblings, 2 replies; 7+ messages in thread
From: ivlipski @ 2024-06-07 16:33 UTC (permalink / raw)
  To: amd-gfx
  Cc: srinivasan.shanmugam, sunpeng.li, harry.wentland,
	rodrigo.siqueira, nicholas.choi, george.zhang, alex.deucher,
	Ivan Lipski

From: Ivan Lipski <ivlipski@amd.com>

[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@amd.com>
---
 .../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


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH 1/2] Revert "drm/amd/display: Add null check for 'afb' in amdgpu_dm_update_cursor"
  2024-06-07 16:33 [PATCH 1/2] Revert "drm/amd/display: Add null check for 'afb' in amdgpu_dm_update_cursor" ivlipski
  2024-06-07 16:33 ` [PATCH 2/2] Revert "drm/amd/display: Add NULL check for 'afb' before dereferencing in amdgpu_dm_plane_handle_cursor_update" ivlipski
@ 2024-06-07 16:49 ` SHANMUGAM, SRINIVASAN
  2024-06-07 17:35 ` Zhang, George
  2 siblings, 0 replies; 7+ messages in thread
From: SHANMUGAM, SRINIVASAN @ 2024-06-07 16:49 UTC (permalink / raw)
  To: LIPSKI, IVAN, amd-gfx@lists.freedesktop.org
  Cc: Li, Sun peng (Leo), Wentland, Harry, Siqueira, Rodrigo,
	Choi, Nicholas, Zhang, George, alex.deucher@amd.com, LIPSKI, IVAN

[-- Attachment #1: Type: text/plain, Size: 2682 bytes --]

[AMD Official Use Only - AMD Internal Distribution Only]

Reviewed-by: Srinivasan Shanmugam <srinivasan.shanmugam@amd.com<mailto:srinivasan.shanmugam@amd.com>>

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

From: Ivan Lipski <ivlipski@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@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


[-- Attachment #2: Type: text/html, Size: 4951 bytes --]

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH 2/2] Revert "drm/amd/display: Add NULL check for 'afb' before dereferencing in amdgpu_dm_plane_handle_cursor_update"
  2024-06-07 16:33 ` [PATCH 2/2] Revert "drm/amd/display: Add NULL check for 'afb' before dereferencing in amdgpu_dm_plane_handle_cursor_update" ivlipski
@ 2024-06-07 16:49   ` SHANMUGAM, SRINIVASAN
  2024-06-07 17:36   ` Zhang, George
  1 sibling, 0 replies; 7+ messages in thread
From: SHANMUGAM, SRINIVASAN @ 2024-06-07 16:49 UTC (permalink / raw)
  To: LIPSKI, IVAN, amd-gfx@lists.freedesktop.org
  Cc: Li, Sun peng (Leo), Wentland, Harry, Siqueira, Rodrigo,
	Choi, Nicholas, Zhang, George, alex.deucher@amd.com, LIPSKI, IVAN

[-- Attachment #1: Type: text/plain, Size: 2769 bytes --]

[AMD Official Use Only - AMD Internal Distribution Only]

Reviewed-by: Srinivasan Shanmugam <srinivasan.shanmugam@amd.com<mailto:srinivasan.shanmugam@amd.com>>

Get Outlook for Android<https://aka.ms/AAb9ysg>
________________________________
From: LIPSKI, IVAN <IVAN.LIPSKI@amd.com>
Sent: Friday, June 7, 2024 10:03:59 PM
To: amd-gfx@lists.freedesktop.org <amd-gfx@lists.freedesktop.org>
Cc: SHANMUGAM, SRINIVASAN <SRINIVASAN.SHANMUGAM@amd.com>; Li, Sun peng (Leo) <Sunpeng.Li@amd.com>; Wentland, Harry <Harry.Wentland@amd.com>; Siqueira, Rodrigo <Rodrigo.Siqueira@amd.com>; Choi, Nicholas <Nicholas.Choi@amd.com>; Zhang, George <George.Zhang@amd.com>; alex.deucher@amd.com <alex.deucher@amd.com>; LIPSKI, IVAN <IVAN.LIPSKI@amd.com>
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@amd.com>

[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@amd.com>
---
 .../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


[-- Attachment #2: Type: text/html, Size: 5196 bytes --]

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* RE: [PATCH 1/2] Revert "drm/amd/display: Add null check for 'afb' in amdgpu_dm_update_cursor"
  2024-06-07 16:33 [PATCH 1/2] Revert "drm/amd/display: Add null check for 'afb' in amdgpu_dm_update_cursor" ivlipski
  2024-06-07 16:33 ` [PATCH 2/2] Revert "drm/amd/display: Add NULL check for 'afb' before dereferencing in amdgpu_dm_plane_handle_cursor_update" ivlipski
  2024-06-07 16:49 ` [PATCH 1/2] Revert "drm/amd/display: Add null check for 'afb' in amdgpu_dm_update_cursor" SHANMUGAM, SRINIVASAN
@ 2024-06-07 17:35 ` Zhang, George
  2 siblings, 0 replies; 7+ messages in thread
From: Zhang, George @ 2024-06-07 17:35 UTC (permalink / raw)
  To: LIPSKI, IVAN, amd-gfx@lists.freedesktop.org
  Cc: SHANMUGAM, SRINIVASAN, Li, Sun peng (Leo), Wentland, Harry,
	Siqueira, Rodrigo, Choi, Nicholas, alex.deucher@amd.com

[AMD Official Use Only - AMD Internal Distribution Only]

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

Thanks,
George

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

From: Ivan Lipski <ivlipski@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@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


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* RE: [PATCH 2/2] Revert "drm/amd/display: Add NULL check for 'afb' before dereferencing in amdgpu_dm_plane_handle_cursor_update"
  2024-06-07 16:33 ` [PATCH 2/2] Revert "drm/amd/display: Add NULL check for 'afb' before dereferencing in amdgpu_dm_plane_handle_cursor_update" ivlipski
  2024-06-07 16:49   ` SHANMUGAM, SRINIVASAN
@ 2024-06-07 17:36   ` Zhang, George
  1 sibling, 0 replies; 7+ messages in thread
From: Zhang, George @ 2024-06-07 17:36 UTC (permalink / raw)
  To: LIPSKI, IVAN, amd-gfx@lists.freedesktop.org
  Cc: SHANMUGAM, SRINIVASAN, Li, Sun peng (Leo), Wentland, Harry,
	Siqueira, Rodrigo, Choi, Nicholas, alex.deucher@amd.com

[AMD Official Use Only - AMD Internal Distribution Only]

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

Thanks,
George

-----Original Message-----
From: LIPSKI, IVAN <IVAN.LIPSKI@amd.com>
Sent: Friday, June 7, 2024 12:34 PM
To: amd-gfx@lists.freedesktop.org
Cc: SHANMUGAM, SRINIVASAN <SRINIVASAN.SHANMUGAM@amd.com>; Li, Sun peng (Leo) <Sunpeng.Li@amd.com>; Wentland, Harry <Harry.Wentland@amd.com>; Siqueira, Rodrigo <Rodrigo.Siqueira@amd.com>; Choi, Nicholas <Nicholas.Choi@amd.com>; Zhang, George <George.Zhang@amd.com>; alex.deucher@amd.com; LIPSKI, IVAN <IVAN.LIPSKI@amd.com>
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@amd.com>

[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@amd.com>
---
 .../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


^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2024-06-07 17:36 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-06-07 16:33 [PATCH 1/2] Revert "drm/amd/display: Add null check for 'afb' in amdgpu_dm_update_cursor" ivlipski
2024-06-07 16:33 ` [PATCH 2/2] Revert "drm/amd/display: Add NULL check for 'afb' before dereferencing in amdgpu_dm_plane_handle_cursor_update" ivlipski
2024-06-07 16:49   ` SHANMUGAM, SRINIVASAN
2024-06-07 17:36   ` Zhang, George
2024-06-07 16:49 ` [PATCH 1/2] Revert "drm/amd/display: Add null check for 'afb' in amdgpu_dm_update_cursor" SHANMUGAM, SRINIVASAN
2024-06-07 17:35 ` Zhang, George
  -- strict thread matches above, loose matches on Subject: below --
2024-06-07 16:33 ivlipski

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox