summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/virtio
diff options
context:
space:
mode:
authorLepton Wu <ytht.net@gmail.com>2017-11-08 10:42:09 -0800
committerGerd Hoffmann <kraxel@redhat.com>2017-11-10 12:45:34 +0100
commit7bac534e027fee318ded13512d12cfaf7d3a937f (patch)
tree8d2be00592b56ad4dcd1cb47d75b8dbfeb7a3f2b /drivers/gpu/drm/virtio
parentad46d7b89371c5920abdcad1ed04fbae68c9c8a9 (diff)
downloadlinux-7bac534e027fee318ded13512d12cfaf7d3a937f.tar.gz
linux-7bac534e027fee318ded13512d12cfaf7d3a937f.tar.bz2
linux-7bac534e027fee318ded13512d12cfaf7d3a937f.zip
drm/virtio: add create_handle support.
Add create_handle support to virtio fb. Without this, screenshot tool in chromium OS can't work. Signed-off-by: Lepton Wu <ytht.net@gmail.com> Link: http://patchwork.freedesktop.org/patch/msgid/20171108184209.46211-1-ytht.net@gmail.com Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/virtio')
-rw-r--r--drivers/gpu/drm/virtio/virtgpu_display.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/drivers/gpu/drm/virtio/virtgpu_display.c b/drivers/gpu/drm/virtio/virtgpu_display.c
index 41b0930f7968..19114a3c5ee4 100644
--- a/drivers/gpu/drm/virtio/virtgpu_display.c
+++ b/drivers/gpu/drm/virtio/virtgpu_display.c
@@ -71,7 +71,19 @@ virtio_gpu_framebuffer_surface_dirty(struct drm_framebuffer *fb,
return virtio_gpu_surface_dirty(virtio_gpu_fb, clips, num_clips);
}
+static int
+virtio_gpu_framebuffer_create_handle(struct drm_framebuffer *fb,
+ struct drm_file *file_priv,
+ unsigned int *handle)
+{
+ struct virtio_gpu_framebuffer *virtio_gpu_fb =
+ to_virtio_gpu_framebuffer(fb);
+
+ return drm_gem_handle_create(file_priv, virtio_gpu_fb->obj, handle);
+}
+
static const struct drm_framebuffer_funcs virtio_gpu_fb_funcs = {
+ .create_handle = virtio_gpu_framebuffer_create_handle,
.destroy = virtio_gpu_user_framebuffer_destroy,
.dirty = virtio_gpu_framebuffer_surface_dirty,
};