Skip to content

Commit 31a679a

Browse files
Ivan Lipskigregkh
authored andcommitted
Revert "drm/amd/display: Add NULL check for 'afb' before dereferencing in amdgpu_dm_plane_handle_cursor_update"
commit 778e397 upstream. [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 38e6f71. Reviewed-by: Srinivasan Shanmugam <srinivasan.shanmugam@amd.com> Tested-by: George Zhang <George.zhang@amd.com> Signed-off-by: Ivan Lipski <ivlipski@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent d8d16fc commit 31a679a

1 file changed

Lines changed: 4 additions & 12 deletions

File tree

drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_plane.c

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1231,22 +1231,14 @@ void amdgpu_dm_plane_handle_cursor_update(struct drm_plane *plane,
12311231
{
12321232
struct amdgpu_device *adev = drm_to_adev(plane->dev);
12331233
struct amdgpu_framebuffer *afb = to_amdgpu_framebuffer(plane->state->fb);
1234-
struct drm_crtc *crtc;
1235-
struct dm_crtc_state *crtc_state;
1236-
struct amdgpu_crtc *amdgpu_crtc;
1237-
u64 address;
1234+
struct drm_crtc *crtc = afb ? plane->state->crtc : old_plane_state->crtc;
1235+
struct dm_crtc_state *crtc_state = crtc ? to_dm_crtc_state(crtc->state) : NULL;
1236+
struct amdgpu_crtc *amdgpu_crtc = to_amdgpu_crtc(crtc);
1237+
uint64_t address = afb ? afb->address : 0;
12381238
struct dc_cursor_position position = {0};
12391239
struct dc_cursor_attributes attributes;
12401240
int ret;
12411241

1242-
if (!afb)
1243-
return;
1244-
1245-
crtc = plane->state->crtc ? plane->state->crtc : old_plane_state->crtc;
1246-
crtc_state = crtc ? to_dm_crtc_state(crtc->state) : NULL;
1247-
amdgpu_crtc = to_amdgpu_crtc(crtc);
1248-
address = afb->address;
1249-
12501242
if (!plane->state->fb && !old_plane_state->fb)
12511243
return;
12521244

0 commit comments

Comments
 (0)