linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] drm/virtio: Allow userspace to mmap() framebuffer
@ 2019-02-28 16:47 Joshua Watt
  2019-03-01  5:51 ` Gerd Hoffmann
  0 siblings, 1 reply; 3+ messages in thread
From: Joshua Watt @ 2019-02-28 16:47 UTC (permalink / raw)
  To: dri-devel, Gerd Hoffmann
  Cc: Joshua Watt, David Airlie, Daniel Vetter, virtualization, linux-kernel

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


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] drm/virtio: Allow userspace to mmap() framebuffer
  2019-02-28 16:47 [PATCH] drm/virtio: Allow userspace to mmap() framebuffer Joshua Watt
@ 2019-03-01  5:51 ` Gerd Hoffmann
  2019-03-01 14:22   ` Joshua Watt
  0 siblings, 1 reply; 3+ messages in thread
From: Gerd Hoffmann @ 2019-03-01  5:51 UTC (permalink / raw)
  To: Joshua Watt
  Cc: dri-devel, David Airlie, Daniel Vetter, virtualization, linux-kernel

On Thu, Feb 28, 2019 at 10:47:41AM -0600, Joshua Watt wrote:
> 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


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] drm/virtio: Allow userspace to mmap() framebuffer
  2019-03-01  5:51 ` Gerd Hoffmann
@ 2019-03-01 14:22   ` Joshua Watt
  0 siblings, 0 replies; 3+ messages in thread
From: Joshua Watt @ 2019-03-01 14:22 UTC (permalink / raw)
  To: Gerd Hoffmann
  Cc: dri-devel, David Airlie, Daniel Vetter, virtualization, linux-kernel

On Fri, 2019-03-01 at 06:51 +0100, Gerd Hoffmann wrote:
> On Thu, Feb 28, 2019 at 10:47:41AM -0600, Joshua Watt wrote:
> > 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!

> 
> cheers,
>   Gerd
> 
-- 
Joshua Watt <JPEWhacker@gmail.com>


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2019-03-01 14:22 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-02-28 16:47 [PATCH] drm/virtio: Allow userspace to mmap() framebuffer Joshua Watt
2019-03-01  5:51 ` Gerd Hoffmann
2019-03-01 14:22   ` Joshua Watt

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).