From: Joshua Watt <jpewhacker@gmail.com>
To: dri-devel@lists.freedesktop.org, Gerd Hoffmann <kraxel@redhat.com>
Cc: Joshua Watt <JPEWhacker@gmail.com>,
David Airlie <airlied@linux.ie>, Daniel Vetter <daniel@ffwll.ch>,
virtualization@lists.linux-foundation.org,
linux-kernel@vger.kernel.org
Subject: [PATCH] drm/virtio: Allow userspace to mmap() framebuffer
Date: Thu, 28 Feb 2019 10:47:41 -0600 [thread overview]
Message-ID: <20190228164741.15590-1-JPEWhacker@gmail.com> (raw)
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
next reply other threads:[~2019-02-28 16:48 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-02-28 16:47 Joshua Watt [this message]
2019-03-01 5:51 ` [PATCH] drm/virtio: Allow userspace to mmap() framebuffer Gerd Hoffmann
2019-03-01 14:22 ` Joshua Watt
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190228164741.15590-1-JPEWhacker@gmail.com \
--to=jpewhacker@gmail.com \
--cc=airlied@linux.ie \
--cc=daniel@ffwll.ch \
--cc=dri-devel@lists.freedesktop.org \
--cc=kraxel@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=virtualization@lists.linux-foundation.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).