diff mbox

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

Message ID 1473619662-20777-4-git-send-email-noralf@tronnes.org (mailing list archive)
State New, archived
Headers show

Commit Message

Noralf Trønnes Sept. 11, 2016, 6:47 p.m. UTC
This enables panic message output support in simpledrm.

Signed-off-by: Noralf Trønnes <noralf@tronnes.org>
---
 drivers/gpu/drm/simpledrm/simpledrm_kms.c | 11 +++++++++++
 1 file changed, 11 insertions(+)
diff mbox

Patch

diff --git a/drivers/gpu/drm/simpledrm/simpledrm_kms.c b/drivers/gpu/drm/simpledrm/simpledrm_kms.c
index deb24cf..32fbf7c 100644
--- a/drivers/gpu/drm/simpledrm/simpledrm_kms.c
+++ b/drivers/gpu/drm/simpledrm/simpledrm_kms.c
@@ -151,10 +151,21 @@  pr_info("%s\n", __func__);
 	kfree(fb);
 }
 
+static void *sdrm_panic_vmap(struct drm_framebuffer *fb)
+{
+	struct sdrm_device *sdrm = fb->dev->dev_private;
+
+	fb->pixel_format = sdrm->hw->format;
+	fb->pitches[0] = sdrm->hw->stride;
+
+	return sdrm->hw->map;
+}
+
 static const struct drm_framebuffer_funcs sdrm_fb_ops = {
 	.create_handle		= sdrm_fb_create_handle,
 	.dirty			= sdrm_fb_dirty,
 	.destroy		= sdrm_fb_destroy,
+	.panic_vmap = sdrm_panic_vmap,
 };
 
 struct sdrm_fb *sdrm_fb_new(struct sdrm_bo *bo,