]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
drm/amdgpu: fix drm panic null pointer when driver not support atomic
authorLu Yao <yaolu@kylinos.cn>
Tue, 6 Jan 2026 02:37:12 +0000 (10:37 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Wed, 14 Jan 2026 19:51:36 +0000 (14:51 -0500)
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 <yaolu@kylinos.cn>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
(cherry picked from commit 2f2a72de673513247cd6fae14e53f6c40c5841ef)

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

index b5d34797d6065aaf0348cbeb569c727490b074b5..52bc04452812eaec57ccbae8a0efca0a91fa2ecc 100644 (file)
@@ -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;