lkml.org 
[lkml]   [2019]   [Feb]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] drm/virtio: Allow userspace to mmap() framebuffer
Date
Reports the size of the virtgpu framebuffer to userspace and installs
the deferred I/O handlers so that userspace can mmap() and write to it.

Signed-off-by: Joshua Watt <JPEWhacker@gmail.com>
---
drivers/gpu/drm/virtio/virtgpu_fb.c | 4 ++++
1 file changed, 4 insertions(+)

diff --git a/drivers/gpu/drm/virtio/virtgpu_fb.c b/drivers/gpu/drm/virtio/virtgpu_fb.c
index fb1cc8b2f119..9f44c8d27c64 100644
--- a/drivers/gpu/drm/virtio/virtgpu_fb.c
+++ b/drivers/gpu/drm/virtio/virtgpu_fb.c
@@ -266,11 +266,15 @@ static int virtio_gpufb_create(struct drm_fb_helper *helper,
info->fbops = &virtio_gpufb_ops;
info->pixmap.flags = FB_PIXMAP_SYSTEM;

+ info->fix.smem_start = 0;
+ info->fix.smem_len = size;
+
info->screen_buffer = obj->vmap;
info->screen_size = obj->gem_base.size;
drm_fb_helper_fill_fix(info, fb->pitches[0], fb->format->depth);
drm_fb_helper_fill_var(info, &vfbdev->helper,
sizes->fb_width, sizes->fb_height);
+ drm_fb_helper_defio_init(helper);

info->fix.mmio_start = 0;
info->fix.mmio_len = 0;
--
2.20.1
\
 
 \ /
  Last update: 2019-02-28 17:49    [W:0.053 / U:0.084 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site