__glXSetCurrentContext(&pcp->base);
}
+static GLboolean
+driIsThreadSafe(void *loaderPrivate)
+{
+ struct dri2_context *pcp = (struct dri2_context *) loaderPrivate;
+ /* Check Xlib is running in thread safe mode
+ *
+ * 'lock_fns' is the XLockDisplay function pointer of the X11 display 'dpy'.
+ * It wll be NULL if XInitThreads wasn't called.
+ */
+ return pcp->base.psc->dpy->lock_fns != NULL;
+}
+
static const __DRIdri2LoaderExtension dri2LoaderExtension = {
.base = { __DRI_DRI2_LOADER, 3 },
};
static const __DRIbackgroundCallableExtension driBackgroundCallable = {
- .base = { __DRI_BACKGROUND_CALLABLE, 1 },
+ .base = { __DRI_BACKGROUND_CALLABLE, 2 },
.setBackgroundContext = driSetBackgroundContext,
+ .isThreadSafe = driIsThreadSafe,
};
_X_HIDDEN void
__glXSetCurrentContext(&pcp->base);
}
+static GLboolean
+dri_is_thread_safe(void *loaderPrivate)
+{
+ /* Unlike DRI2, DRI3 doesn't call GetBuffers/GetBuffersWithFormat
+ * during draw so we're safe here.
+ */
+ return true;
+}
+
/* The image loader extension record for DRI3
*/
static const __DRIimageLoaderExtension imageLoaderExtension = {
};
static const __DRIbackgroundCallableExtension driBackgroundCallable = {
- .base = { __DRI_BACKGROUND_CALLABLE, 1 },
+ .base = { __DRI_BACKGROUND_CALLABLE, 2 },
.setBackgroundContext = dri_set_background_context,
+ .isThreadSafe = dri_is_thread_safe,
};
static const __DRIextension *loader_extensions[] = {