All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/cirrus: implement create_handle for framebuffers
@ 2017-05-18 19:03 Nicholas Bishop
  0 siblings, 0 replies; 2+ messages in thread
From: Nicholas Bishop @ 2017-05-18 19:03 UTC (permalink / raw)
  To: dri-devel; +Cc: Nicholas Bishop

This fixes the DRM_IOCTL_MODE_GETFB ioctl for cirrus so that it
returns an actual handle instead of failing with ENODEV.

Tested in a QEMU VM with "-vga cirrus" by running this script:

https://chromium.googlesource.com/chromiumos/third_party/autotest/+/master/client/bin/screenshot.py

Implementation cargo-culted from radeon_user_framebuffer_create_handle().

Signed-off-by: Nicholas Bishop <nbishop@neverware.com>
---
 drivers/gpu/drm/cirrus/cirrus_main.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/drivers/gpu/drm/cirrus/cirrus_main.c b/drivers/gpu/drm/cirrus/cirrus_main.c
index e7fc95f..2b0b27b 100644
--- a/drivers/gpu/drm/cirrus/cirrus_main.c
+++ b/drivers/gpu/drm/cirrus/cirrus_main.c
@@ -23,8 +23,18 @@ static void cirrus_user_framebuffer_destroy(struct drm_framebuffer *fb)
 	kfree(fb);
 }
 
+static int cirrus_user_framebuffer_create_handle(struct drm_framebuffer *fb,
+						 struct drm_file *file_priv,
+						 unsigned int *handle)
+{
+	struct cirrus_framebuffer *cirrus_fb = to_cirrus_framebuffer(fb);
+
+	return drm_gem_handle_create(file_priv, cirrus_fb->obj, handle);
+}
+
 static const struct drm_framebuffer_funcs cirrus_fb_funcs = {
 	.destroy = cirrus_user_framebuffer_destroy,
+	.create_handle = cirrus_user_framebuffer_create_handle,
 };
 
 int cirrus_framebuffer_init(struct drm_device *dev,
-- 
2.9.4

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

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

* [PATCH] drm/cirrus: implement create_handle for framebuffers
@ 2017-05-18 20:28 Nicholas Bishop
  0 siblings, 0 replies; 2+ messages in thread
From: Nicholas Bishop @ 2017-05-18 20:28 UTC (permalink / raw)
  To: dri-devel; +Cc: Nicholas Bishop

This fixes the DRM_IOCTL_MODE_GETFB ioctl for cirrus so that it
returns an actual handle instead of failing with ENODEV.

Tested in a QEMU VM with "-vga cirrus" by running this script:

https://chromium.googlesource.com/chromiumos/third_party/autotest/+/master/client/bin/screenshot.py

Implementation cargo-culted from radeon_user_framebuffer_create_handle().

Signed-off-by: Nicholas Bishop <nbishop@neverware.com>
---
 drivers/gpu/drm/cirrus/cirrus_main.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/drivers/gpu/drm/cirrus/cirrus_main.c b/drivers/gpu/drm/cirrus/cirrus_main.c
index e7fc95f..2b0b27b 100644
--- a/drivers/gpu/drm/cirrus/cirrus_main.c
+++ b/drivers/gpu/drm/cirrus/cirrus_main.c
@@ -23,8 +23,18 @@ static void cirrus_user_framebuffer_destroy(struct drm_framebuffer *fb)
 	kfree(fb);
 }
 
+static int cirrus_user_framebuffer_create_handle(struct drm_framebuffer *fb,
+						 struct drm_file *file_priv,
+						 unsigned int *handle)
+{
+	struct cirrus_framebuffer *cirrus_fb = to_cirrus_framebuffer(fb);
+
+	return drm_gem_handle_create(file_priv, cirrus_fb->obj, handle);
+}
+
 static const struct drm_framebuffer_funcs cirrus_fb_funcs = {
 	.destroy = cirrus_user_framebuffer_destroy,
+	.create_handle = cirrus_user_framebuffer_create_handle,
 };
 
 int cirrus_framebuffer_init(struct drm_device *dev,
-- 
2.9.4

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

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

end of thread, other threads:[~2017-05-18 20:28 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-05-18 19:03 [PATCH] drm/cirrus: implement create_handle for framebuffers Nicholas Bishop
2017-05-18 20:28 Nicholas Bishop

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.