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

drm/bochs: Add support for drm_panic

Add drm_panic module for bochs drm so that panic screen can be displayed
on panic.

Signed-off-by: Ryosuke Yasuoka <ryasuoka@redhat.com>
Reviewed-by: Jocelyn Falempe <jfalempe@redhat.com>
Link: https://lore.kernel.org/r/20250613132023.106946-1-ryasuoka@redhat.com
Signed-off-by: Jocelyn Falempe <jfalempe@redhat.com>

authored by

Ryosuke Yasuoka and committed by
Jocelyn Falempe
a629feab 3828a643

+19
+19
drivers/gpu/drm/tiny/bochs.c
··· 19 19 #include <drm/drm_gem_shmem_helper.h> 20 20 #include <drm/drm_managed.h> 21 21 #include <drm/drm_module.h> 22 + #include <drm/drm_panic.h> 22 23 #include <drm/drm_plane_helper.h> 23 24 #include <drm/drm_probe_helper.h> 24 25 ··· 470 469 bochs_hw_setformat(bochs, fb->format); 471 470 } 472 471 472 + static int bochs_primary_plane_helper_get_scanout_buffer(struct drm_plane *plane, 473 + struct drm_scanout_buffer *sb) 474 + { 475 + struct bochs_device *bochs = to_bochs_device(plane->dev); 476 + struct iosys_map map = IOSYS_MAP_INIT_VADDR_IOMEM(bochs->fb_map); 477 + 478 + if (plane->state && plane->state->fb) { 479 + sb->format = plane->state->fb->format; 480 + sb->width = plane->state->fb->width; 481 + sb->height = plane->state->fb->height; 482 + sb->pitch[0] = plane->state->fb->pitches[0]; 483 + sb->map[0] = map; 484 + return 0; 485 + } 486 + return -ENODEV; 487 + } 488 + 473 489 static const struct drm_plane_helper_funcs bochs_primary_plane_helper_funcs = { 474 490 DRM_GEM_SHADOW_PLANE_HELPER_FUNCS, 475 491 .atomic_check = bochs_primary_plane_helper_atomic_check, 476 492 .atomic_update = bochs_primary_plane_helper_atomic_update, 493 + .get_scanout_buffer = bochs_primary_plane_helper_get_scanout_buffer, 477 494 }; 478 495 479 496 static const struct drm_plane_funcs bochs_primary_plane_funcs = {