summaryrefslogtreecommitdiffstats
path: root/src/egl/drivers/dri2/egl_dri2.c
diff options
context:
space:
mode:
authorEric Anholt <[email protected]>2012-12-27 17:39:37 -0800
committerTimothy Arceri <[email protected]>2017-03-16 14:14:18 +1100
commit3b7b6adf3ac688f75f11624e551800d0d978293b (patch)
tree765b6d428c22127220e1e0dd01450064ce2d77d3 /src/egl/drivers/dri2/egl_dri2.c
parent6b70d9fce39c32929372fb8cf62f1f9072fe91e1 (diff)
egl: Implement __DRI_BACKGROUND_CALLABLE
v2: (Timothy Arceri) use C99 initializers. Acked-by: Timothy Arceri <[email protected]> Acked-by: Marek Olšák <[email protected]> Tested-by: Dieter Nützel <[email protected]> Tested-by: Mike Lothian <[email protected]>
Diffstat (limited to 'src/egl/drivers/dri2/egl_dri2.c')
-rw-r--r--src/egl/drivers/dri2/egl_dri2.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/egl/drivers/dri2/egl_dri2.c b/src/egl/drivers/dri2/egl_dri2.c
index 4bab6f1c5e2..2cab7d00c1f 100644
--- a/src/egl/drivers/dri2/egl_dri2.c
+++ b/src/egl/drivers/dri2/egl_dri2.c
@@ -83,6 +83,21 @@
#define DRM_FORMAT_GR1616 fourcc_code('G', 'R', '3', '2') /* [31:0] R:G 16:16 little endian */
#endif
+static void
+dri_set_background_context(void *loaderPrivate)
+{
+ _EGLContext *ctx = _eglGetCurrentContext();
+ _EGLThreadInfo *t = _eglGetCurrentThread();
+
+ _eglBindContextToThread(ctx, t);
+}
+
+const __DRIbackgroundCallableExtension background_callable_extension = {
+ .base = { __DRI_BACKGROUND_CALLABLE, 1 },
+
+ .setBackgroundContext = dri_set_background_context,
+};
+
const __DRIuseInvalidateExtension use_invalidate = {
.base = { __DRI_USE_INVALIDATE, 1 }
};