AMD-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: <ivlipski@amd.com>
To: <amd-gfx@lists.freedesktop.org>
Cc: <srinivasan.shanmugam@amd.com>, <sunpeng.li@amd.com>,
	<harry.wentland@amd.com>, <rodrigo.siqueira@amd.com>,
	<nicholas.choi@amd.com>, <george.zhang@amd.com>,
	<alex.deucher@amd.com>, "Ivan Lipski" <ivlipski@amd.com>
Subject: [PATCH 2/2] Revert "drm/amd/display: Add NULL check for 'afb' before dereferencing in amdgpu_dm_plane_handle_cursor_update"
Date: Fri, 7 Jun 2024 12:33:59 -0400	[thread overview]
Message-ID: <20240607163359.18299-2-ivlipski@amd.com> (raw)
In-Reply-To: <20240607163359.18299-1-ivlipski@amd.com>

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


  reply	other threads:[~2024-06-07 16:34 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
2024-06-07 16:49   ` [PATCH 2/2] Revert "drm/amd/display: Add NULL check for 'afb' before dereferencing in amdgpu_dm_plane_handle_cursor_update" 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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240607163359.18299-2-ivlipski@amd.com \
    --to=ivlipski@amd.com \
    --cc=alex.deucher@amd.com \
    --cc=amd-gfx@lists.freedesktop.org \
    --cc=george.zhang@amd.com \
    --cc=harry.wentland@amd.com \
    --cc=nicholas.choi@amd.com \
    --cc=rodrigo.siqueira@amd.com \
    --cc=srinivasan.shanmugam@amd.com \
    --cc=sunpeng.li@amd.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox