Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Lepton Wu and committed by
Gerd Hoffmann
7bac534e ad46d7b8

+12
+12
drivers/gpu/drm/virtio/virtgpu_display.c
··· 71 71 return virtio_gpu_surface_dirty(virtio_gpu_fb, clips, num_clips); 72 72 } 73 73 74 + static int 75 + virtio_gpu_framebuffer_create_handle(struct drm_framebuffer *fb, 76 + struct drm_file *file_priv, 77 + unsigned int *handle) 78 + { 79 + struct virtio_gpu_framebuffer *virtio_gpu_fb = 80 + to_virtio_gpu_framebuffer(fb); 81 + 82 + return drm_gem_handle_create(file_priv, virtio_gpu_fb->obj, handle); 83 + } 84 + 74 85 static const struct drm_framebuffer_funcs virtio_gpu_fb_funcs = { 86 + .create_handle = virtio_gpu_framebuffer_create_handle, 75 87 .destroy = virtio_gpu_user_framebuffer_destroy, 76 88 .dirty = virtio_gpu_framebuffer_surface_dirty, 77 89 };