[PATCH 2/3] drm/fb_cma_helper: Add panic handling

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

 



This enables panic message output for fb cma helper framebuffers.

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

diff --git a/drivers/gpu/drm/drm_fb_cma_helper.c b/drivers/gpu/drm/drm_fb_cma_helper.c
index 1fd6eac..2f1b012 100644
--- a/drivers/gpu/drm/drm_fb_cma_helper.c
+++ b/drivers/gpu/drm/drm_fb_cma_helper.c
@@ -126,9 +126,19 @@ int drm_fb_cma_create_handle(struct drm_framebuffer *fb,
 }
 EXPORT_SYMBOL(drm_fb_cma_create_handle);
 
+static void *drm_fb_cma_panic_vmap(struct drm_framebuffer *fb)
+{
+	struct drm_fb_cma *fb_cma = to_fb_cma(fb);
+	struct drm_gem_cma_object *cma_obj = fb_cma->obj[0];
+
+	/* A PRIME imported buffer will not have it's vaddr set. */
+	return cma_obj ? cma_obj->vaddr : NULL;
+}
+
 static struct drm_framebuffer_funcs drm_fb_cma_funcs = {
 	.destroy	= drm_fb_cma_destroy,
 	.create_handle	= drm_fb_cma_create_handle,
+	.panic_vmap	= drm_fb_cma_panic_vmap,
 };
 
 static struct drm_fb_cma *drm_fb_cma_alloc(struct drm_device *dev,
-- 
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