summaryrefslogtreecommitdiff
path: root/glamor
diff options
context:
space:
mode:
authorDave Airlie <airlied@redhat.com>2014-12-09 12:28:38 -0800
committerKenneth Graunke <kenneth@whitecape.org>2014-12-11 11:26:19 -0800
commitcfef64b0cabe7677c7584a72d7432c20343d9361 (patch)
treebd03b13ce1ae34c3a0edfa0889f980b9d060cb96 /glamor
parent980535757d38db5c812c8afa32726d8cc36abfa4 (diff)
glamor: Add an accessor for the GBM device.
(Originally written by Dave Airlie; split into a separate patch by Kenneth Graunke.) Signed-off-by: Dave Airlie <airlied@redhat.com> Signed-off-by: Kenneth Graunke <kenneth@whitecape.org> Tested-by: Jason Ekstrand <jason.ekstrand@intel.com> Reviewed-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'glamor')
-rw-r--r--glamor/glamor.h2
-rw-r--r--glamor/glamor_egl.c12
2 files changed, 14 insertions, 0 deletions
diff --git a/glamor/glamor.h b/glamor/glamor.h
index 95c425306..206158c02 100644
--- a/glamor/glamor.h
+++ b/glamor/glamor.h
@@ -172,6 +172,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 898081a4a..113450c8d 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)
{