drm/amdgpu: fix drm panic null pointer when driver not support atomic
Subsystems (2)
PATCH 1/1 drm/amdgpu: fix drm panic null pointer when driver not support atomic
From: Lu Yao <[email protected]>
When driver not support atomic, fb using plane->fb rather than plane->state->fb.
Fixes fe151ed7af54 ("drm/amdgpu: add generic display panic helper code")
Signed-off-by Lu Yao <[email protected]>
--- drivers/gpu/drm/amd/amdgpu/amdgpu_display.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_display.c +6 -1
@@ -1880,7 +1880,12 @@ int amdgpu_display_get_scanout_buffer(struct drm_plane *plane, struct drm_scanout_buffer *sb) {struct amdgpu_bo *abo; -struct drm_framebuffer *fb = plane->state->fb; +struct drm_framebuffer *fb; + +if (drm_drv_uses_atomic_modeset (plane->dev)) + fb = plane->state->fb; +else + fb = plane->fb;if (!fb)return -EINVAL ;
Signature · 1 line
2.25.1
Alex Deucher
AppliedApplied. Thanks!
Quoted 33 lines · On Mon, Jan 5, 2026 at 9:37 PM <[email protected]> wrote:
From: Lu Yao <[email protected]>
When driver not support atomic, fb using
plane->fbrather thanplane->state->fb.Fixes fe151ed7af54 ("drm/amdgpu: add generic display panic helper code")Signed-off-by Lu Yao <[email protected]>--- drivers/gpu/drm/amd/amdgpu/amdgpu_display.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)drivers/gpu/drm/amd/amdgpu/amdgpu_display.c +6
-2@@ -1880,7 +1880,12 @@ int amdgpu_display_get_scanout_buffer(struct drm_plane *plane, struct drm_scanout_buffer *sb) {struct amdgpu_bo *abo; -struct drm_framebuffer *fb = plane->state->fb; +struct drm_framebuffer *fb; + +if (drm_drv_uses_atomic_modeset (plane->dev)) + fb = plane->state->fb; +else + fb = plane->fb;if (!fb)return -EINVAL ; --2.25.1