linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH drm-next] drm/bochs: Add support for drm_panic
@ 2025-06-13 13:20 Ryosuke Yasuoka
  2025-06-19  6:12 ` Jocelyn Falempe
                   ` (2 more replies)
  0 siblings, 3 replies; 11+ messages in thread
From: Ryosuke Yasuoka @ 2025-06-13 13:20 UTC (permalink / raw)
  To: kraxel, maarten.lankhorst, mripard, tzimmermann, airlied, simona,
	jfalempe
  Cc: Ryosuke Yasuoka, virtualization, linux-kernel, dri-devel

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

Signed-off-by: Ryosuke Yasuoka <ryasuoka@redhat.com>
---
 drivers/gpu/drm/tiny/bochs.c | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)

diff --git a/drivers/gpu/drm/tiny/bochs.c b/drivers/gpu/drm/tiny/bochs.c
index 8706763af8fb..ed42ad5c4927 100644
--- a/drivers/gpu/drm/tiny/bochs.c
+++ b/drivers/gpu/drm/tiny/bochs.c
@@ -19,6 +19,7 @@
 #include <drm/drm_gem_shmem_helper.h>
 #include <drm/drm_managed.h>
 #include <drm/drm_module.h>
+#include <drm/drm_panic.h>
 #include <drm/drm_plane_helper.h>
 #include <drm/drm_probe_helper.h>
 
@@ -469,10 +470,28 @@ static void bochs_primary_plane_helper_atomic_update(struct drm_plane *plane,
 	bochs_hw_setformat(bochs, fb->format);
 }
 
+static int bochs_primary_plane_helper_get_scanout_buffer(struct drm_plane *plane,
+							  struct drm_scanout_buffer *sb)
+{
+	struct bochs_device *bochs = to_bochs_device(plane->dev);
+	struct iosys_map map = IOSYS_MAP_INIT_VADDR_IOMEM(bochs->fb_map);
+
+	if (plane->state && plane->state->fb) {
+		sb->format = plane->state->fb->format;
+		sb->width = plane->state->fb->width;
+		sb->height = plane->state->fb->height;
+		sb->pitch[0] = plane->state->fb->pitches[0];
+		sb->map[0] = map;
+		return 0;
+	}
+	return -ENODEV;
+}
+
 static const struct drm_plane_helper_funcs bochs_primary_plane_helper_funcs = {
 	DRM_GEM_SHADOW_PLANE_HELPER_FUNCS,
 	.atomic_check = bochs_primary_plane_helper_atomic_check,
 	.atomic_update = bochs_primary_plane_helper_atomic_update,
+	.get_scanout_buffer = bochs_primary_plane_helper_get_scanout_buffer,
 };
 
 static const struct drm_plane_funcs bochs_primary_plane_funcs = {

base-commit: 19272b37aa4f83ca52bdf9c16d5d81bdd1354494
-- 
2.49.0


^ permalink raw reply related	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2025-07-17  9:54 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-06-13 13:20 [PATCH drm-next] drm/bochs: Add support for drm_panic Ryosuke Yasuoka
2025-06-19  6:12 ` Jocelyn Falempe
2025-06-19  6:37   ` Ryosuke Yasuoka
2025-06-19  6:42     ` Jocelyn Falempe
2025-06-23 10:12 ` Jocelyn Falempe
2025-07-14  0:04 ` Askar Safin
2025-07-15  8:57   ` Jocelyn Falempe
2025-07-15 20:35     ` Askar Safin
2025-07-15 22:00       ` Jocelyn Falempe
2025-07-16 21:48         ` Askar Safin
2025-07-17  9:54           ` Jocelyn Falempe

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).