Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm/simpledrm: Add drm_panic support

Add support for the drm_panic module, which displays a user-friendly
message to the screen when a kernel panic occurs.

v8:
* Replace get_scanout_buffer() with drm_panic_set_buffer()
(Thomas Zimmermann)

v9:
* Revert to using get_scanout_buffer() (Sima)
* move get_scanout_buffer() to plane helper functions (Thomas Zimmermann)

v12:
* Use array for map and pitch in struct drm_scanout_buffer
to support multi-planar format later. (Thomas Zimmermann)

Signed-off-by: Jocelyn Falempe <jfalempe@redhat.com>
Reviewed-by: Thomas Zimmermann <tzimmermann@suse.de>
Link: https://patchwork.freedesktop.org/patch/msgid/20240409163432.352518-7-jfalempe@redhat.com
Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>

+16
+16
drivers/gpu/drm/tiny/simpledrm.c
··· 25 25 #include <drm/drm_gem_shmem_helper.h> 26 26 #include <drm/drm_managed.h> 27 27 #include <drm/drm_modeset_helper_vtables.h> 28 + #include <drm/drm_panic.h> 28 29 #include <drm/drm_probe_helper.h> 29 30 30 31 #define DRIVER_NAME "simpledrm" ··· 672 671 drm_dev_exit(idx); 673 672 } 674 673 674 + static int simpledrm_primary_plane_helper_get_scanout_buffer(struct drm_plane *plane, 675 + struct drm_scanout_buffer *sb) 676 + { 677 + struct simpledrm_device *sdev = simpledrm_device_of_dev(plane->dev); 678 + 679 + sb->width = sdev->mode.hdisplay; 680 + sb->height = sdev->mode.vdisplay; 681 + sb->format = sdev->format; 682 + sb->pitch[0] = sdev->pitch; 683 + sb->map[0] = sdev->screen_base; 684 + 685 + return 0; 686 + } 687 + 675 688 static const struct drm_plane_helper_funcs simpledrm_primary_plane_helper_funcs = { 676 689 DRM_GEM_SHADOW_PLANE_HELPER_FUNCS, 677 690 .atomic_check = simpledrm_primary_plane_helper_atomic_check, 678 691 .atomic_update = simpledrm_primary_plane_helper_atomic_update, 679 692 .atomic_disable = simpledrm_primary_plane_helper_atomic_disable, 693 + .get_scanout_buffer = simpledrm_primary_plane_helper_get_scanout_buffer, 680 694 }; 681 695 682 696 static const struct drm_plane_funcs simpledrm_primary_plane_funcs = {