Skip to contentSkip to conversation

drm/virtio: Allow userspace to mmap() framebuffer

PATCH In review Joshua Watt 2 participants 4 messages Feb 28, 2019 – Mar 1, 2019

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/virtio: Allow userspace to mmap() framebuffer

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.

---
 drivers/gpu/drm/virtio/virtgpu_fb.c | 4 ++++
 1 file changed, 4 insertions(+)
drivers/gpu/drm/virtio/virtgpu_fb.c +4 -0
index fb1cc8b2f119..9f44c8d27c64 100644
@@ -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;
Signature · 1 line
2.20.1
maintainer
#1 lore raw
Quoted 2 lines · Joshua Watt

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.

Fixed already, as side effect of switching virtio to the generic fbdev emulation. Patches are in the drm-misc-next branch and should land upstream in the 5.1 merge window.

cheers,
Gerd

maintainer
#2 lore raw
In reply to Joshua Watt
Quoted 2 lines · Joshua Watt

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.

Fixed already, as side effect of switching virtio to the generic fbdev emulation. Patches are in the drm-misc-next branch and should land upstream in the 5.1 merge window.

cheers,
Gerd

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

#3 lore raw
Quoted 10 lines · Gerd Hoffmann
Quoted 4 lines · Joshua Watt

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.

Fixed already, as side effect of switching virtio to the generic fbdev
emulation. Patches are in the drm-misc-next branch and should land upstream in the 5.1 merge window.

Excellent. I gave it a try and that did what I needed. Thanks!

Quoted 4 lines

cheers,
Gerd

Signature · 1 line
Joshua Watt <[email protected]>