]> git.ipfire.org Git - thirdparty/kernel/stable.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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 23 Jan 2026 10:21:19 +0000 (11:21 +0100)
[ Upstream commit 9cb6278b44c38899961b36d303d7b18b38be2a6e ]

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)
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/gpu/drm/amd/amdgpu/amdgpu_display.c

index 51bab32fd8c6fcd41378744668be0bc578b5714e..2f416d12e2e7eedcb45a8f98c3b172226d4cc02c 100644 (file)
@@ -1824,7 +1824,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;