Skip to content

Commit 9cb6278

Browse files
Lu Yaoalexdeucher
authored andcommitted
drm/amdgpu: fix drm panic null pointer when driver not support atomic
When driver not support atomic, fb using plane->fb rather than plane->state->fb. Fixes: fe151ed ("drm/amdgpu: add generic display panic helper code") Signed-off-by: Lu Yao <yaolu@kylinos.cn> Signed-off-by: Alex Deucher <alexander.deucher@amd.com> (cherry picked from commit 2f2a72d)
1 parent 292e575 commit 9cb6278

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

drivers/gpu/drm/amd/amdgpu/amdgpu_display.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1880,7 +1880,12 @@ int amdgpu_display_get_scanout_buffer(struct drm_plane *plane,
18801880
struct drm_scanout_buffer *sb)
18811881
{
18821882
struct amdgpu_bo *abo;
1883-
struct drm_framebuffer *fb = plane->state->fb;
1883+
struct drm_framebuffer *fb;
1884+
1885+
if (drm_drv_uses_atomic_modeset(plane->dev))
1886+
fb = plane->state->fb;
1887+
else
1888+
fb = plane->fb;
18841889

18851890
if (!fb)
18861891
return -EINVAL;

0 commit comments

Comments
 (0)