/* Do this last. */
if (ctx->st->start_thread &&
- driQueryOptionb(&screen->dev->option_cache, "mesa_glthread")) {
-
- if (backgroundCallable && backgroundCallable->base.version >= 2 &&
- backgroundCallable->isThreadSafe) {
-
- if (backgroundCallable->isThreadSafe(cPriv->loaderPrivate))
- ctx->st->start_thread(ctx->st);
- else
- fprintf(stderr, "dri_create_context: glthread isn't thread safe "
- "- missing call XInitThreads\n");
- } else {
- fprintf(stderr, "dri_create_context: requested glthread but driver "
- "is missing backgroundCallable V2 extension\n");
- }
+ driQueryOptionb(&screen->dev->option_cache, "mesa_glthread")) {
+ bool safe = true;
+
+ /* This is only needed by X11/DRI2, which can be unsafe. */
+ if (backgroundCallable &&
+ backgroundCallable->base.version >= 2 &&
+ backgroundCallable->isThreadSafe &&
+ !backgroundCallable->isThreadSafe(cPriv->loaderPrivate))
+ safe = false;
+
+ if (safe)
+ ctx->st->start_thread(ctx->st);
}
*error = __DRI_CTX_ERROR_SUCCESS;
const __DRIbackgroundCallableExtension *backgroundCallable =
ctx->sPriv->dri2.backgroundCallable;
- /* Note: Mesa will only call this function if GL multithreading is enabled
- * We only do that if the loader exposed the __DRI_BACKGROUND_CALLABLE
- * extension. So we know that backgroundCallable is not NULL.
- */
- assert(backgroundCallable);
- backgroundCallable->setBackgroundContext(ctx->cPriv->loaderPrivate);
+ if (backgroundCallable)
+ backgroundCallable->setBackgroundContext(ctx->cPriv->loaderPrivate);
if (ctx->hud)
hud_add_queue_for_monitoring(ctx->hud, queue_info);