]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob
2642d070f53856425b854aa67b9d8bc3998a9929
[thirdparty/kernel/stable-queue.git] /
1 From 778e3979c5dc9cbdb5d1b92afed427de6bc483b4 Mon Sep 17 00:00:00 2001
2 From: Ivan Lipski <ivlipski@amd.com>
3 Date: Fri, 7 Jun 2024 12:33:59 -0400
4 Subject: Revert "drm/amd/display: Add NULL check for 'afb' before dereferencing in amdgpu_dm_plane_handle_cursor_update"
5
6 From: Ivan Lipski <ivlipski@amd.com>
7
8 commit 778e3979c5dc9cbdb5d1b92afed427de6bc483b4 upstream.
9
10 [WHY]
11 This patch is a dupplicate implementation of 14bcf29b, which we
12 are reverting due to a regression with kms_plane_cursor IGT tests.
13
14 This reverts commit 38e6f715b02b572f74677eb2f29d3b4bc6f1ddff.
15
16 Reviewed-by: Srinivasan Shanmugam <srinivasan.shanmugam@amd.com>
17 Tested-by: George Zhang <George.zhang@amd.com>
18 Signed-off-by: Ivan Lipski <ivlipski@amd.com>
19 Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
20 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
21 ---
22 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_plane.c | 16 ++++------------
23 1 file changed, 4 insertions(+), 12 deletions(-)
24
25 --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_plane.c
26 +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_plane.c
27 @@ -1231,22 +1231,14 @@ void amdgpu_dm_plane_handle_cursor_updat
28 {
29 struct amdgpu_device *adev = drm_to_adev(plane->dev);
30 struct amdgpu_framebuffer *afb = to_amdgpu_framebuffer(plane->state->fb);
31 - struct drm_crtc *crtc;
32 - struct dm_crtc_state *crtc_state;
33 - struct amdgpu_crtc *amdgpu_crtc;
34 - u64 address;
35 + struct drm_crtc *crtc = afb ? plane->state->crtc : old_plane_state->crtc;
36 + struct dm_crtc_state *crtc_state = crtc ? to_dm_crtc_state(crtc->state) : NULL;
37 + struct amdgpu_crtc *amdgpu_crtc = to_amdgpu_crtc(crtc);
38 + uint64_t address = afb ? afb->address : 0;
39 struct dc_cursor_position position = {0};
40 struct dc_cursor_attributes attributes;
41 int ret;
42
43 - if (!afb)
44 - return;
45 -
46 - crtc = plane->state->crtc ? plane->state->crtc : old_plane_state->crtc;
47 - crtc_state = crtc ? to_dm_crtc_state(crtc->state) : NULL;
48 - amdgpu_crtc = to_amdgpu_crtc(crtc);
49 - address = afb->address;
50 -
51 if (!plane->state->fb && !old_plane_state->fb)
52 return;
53