[PATCH 7/8] glamor: Add an accessor for the GBM device.

Kenneth Graunke kenneth at whitecape.org
Tue Dec 9 16:55:30 PST 2014


From: Dave Airlie <airlied at redhat.com>

(Originally written by Dave Airlie; split into a separate patch by
Kenneth Graunke.)

Signed-off-by: Dave Airlie <airlied at redhat.com>
Signed-off-by: Kenneth Graunke <kenneth at whitecape.org>
---
 glamor/glamor.h     |  2 ++
 glamor/glamor_egl.c | 12 ++++++++++++
 2 files changed, 14 insertions(+)

diff --git a/glamor/glamor.h b/glamor/glamor.h
index 1683414..05ba8c4 100644
--- a/glamor/glamor.h
+++ b/glamor/glamor.h
@@ -171,6 +171,8 @@ extern _X_EXPORT int glamor_egl_dri3_fd_name_from_tex(ScreenPtr, PixmapPtr,
 
 extern void glamor_egl_destroy_pixmap_image(PixmapPtr pixmap);
 
+extern _X_EXPORT void *glamor_egl_get_gbm_device(ScreenPtr screen);
+
 /* @glamor_supports_pixmap_import_export: Returns whether
  * glamor_fd_from_pixmap(), glamor_name_from_pixmap(), and
  * glamor_pixmap_from_fd() are supported.
diff --git a/glamor/glamor_egl.c b/glamor/glamor_egl.c
index e821601..d2d5a0d 100644
--- a/glamor/glamor_egl.c
+++ b/glamor/glamor_egl.c
@@ -174,6 +174,18 @@ glamor_create_texture_from_image(ScreenPtr screen,
     return TRUE;
 }
 
+void *
+glamor_egl_get_gbm_device(ScreenPtr screen)
+{
+#ifdef GLAMOR_HAS_GBM
+    struct glamor_egl_screen_private *glamor_egl =
+        glamor_egl_get_screen_private(xf86ScreenToScrn(screen));
+    return glamor_egl->gbm;
+#else
+    return NULL;
+#endif
+}
+
 unsigned int
 glamor_egl_create_argb8888_based_texture(ScreenPtr screen, int w, int h)
 {
-- 
2.1.3



More information about the xorg-devel mailing list