Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 7bac534e authored by Lepton Wu's avatar Lepton Wu Committed by Gerd Hoffmann
Browse files

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: default avatarLepton Wu <ytht.net@gmail.com>
Link: http://patchwork.freedesktop.org/patch/msgid/20171108184209.46211-1-ytht.net@gmail.com


Signed-off-by: default avatarGerd Hoffmann <kraxel@redhat.com>
parent ad46d7b8
Loading
Loading
Loading
Loading
+12 −0
Original line number Diff line number Diff line
@@ -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,
};