[RFC 3/3] drm: simpledrm: Add panic handling

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This enables panic message output support in simpledrm.
simpledrm has a fixed buffer that is set up to be scanned out
and the virtual address is already available.

Signed-off-by: Noralf Trønnes <noralf@xxxxxxxxxxx>
---
 drivers/gpu/drm/simpledrm/simpledrm_drv.c | 24 ++++++++++++++++++++++++
 1 file changed, 24 insertions(+)

diff --git a/drivers/gpu/drm/simpledrm/simpledrm_drv.c b/drivers/gpu/drm/simpledrm/simpledrm_drv.c
index a329e4c..ceff617 100644
--- a/drivers/gpu/drm/simpledrm/simpledrm_drv.c
+++ b/drivers/gpu/drm/simpledrm/simpledrm_drv.c
@@ -23,6 +23,29 @@
 #include <drm/drmP.h>
 #include "simpledrm.h"
 
+static struct drm_framebuffer sdrm_panic_fb;
+
+struct drm_framebuffer *sdrm_panic(struct drm_device *dev, void **vmem)
+{
+	struct sdrm_device *sdrm = dev->dev_private;
+	struct drm_framebuffer *fb = &sdrm_panic_fb;
+
+	if (!sdrm)
+		return NULL;
+
+	fb->dev = dev;
+	fb->width = sdrm->fb_width;
+	fb->height = sdrm->fb_height;
+	fb->pixel_format = sdrm->fb_format;
+	drm_fb_get_bpp_depth(fb->pixel_format, &fb->depth,
+			     &fb->bits_per_pixel);
+	fb->pitches[0] = sdrm->fb_stride;
+
+	*vmem = sdrm->fb_map;
+
+	return fb;
+}
+
 static const struct file_operations sdrm_drm_fops = {
 	.owner = THIS_MODULE,
 	.open = drm_open,
@@ -42,6 +65,7 @@ static struct drm_driver sdrm_drm_driver = {
 			   DRIVER_ATOMIC,
 	.fops = &sdrm_drm_fops,
 	.lastclose = sdrm_lastclose,
+	.panic = sdrm_panic,
 
 	.gem_free_object = sdrm_gem_free_object,
 	.prime_fd_to_handle = drm_gem_prime_fd_to_handle,
-- 
2.8.2

_______________________________________________
dri-devel mailing list
dri-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/dri-devel




[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux