[Mesa-dev] [PATCH v4 3/4] egl: implement __DRIbackgroundCallableExtension.isThreadSafe

Daniel Stone daniel at fooishbar.org
Mon May 22 07:14:27 UTC 2017


Hi Gregory,

On 21 May 2017 at 15:59, Gregory Hainaut <gregory.hainaut at gmail.com> wrote:
> +static GLboolean
> +dri_is_thread_safe(void *loaderPrivate)
> +{
> +#ifdef HAVE_X11_PLATFORM
> +   struct dri2_egl_surface *dri2_surf = loaderPrivate;
> +   _EGLDisplay *display =  dri2_surf->base.Resource.Display;

Move these out of the ifdef, and ...

> +   Display *xdpy = (Display*)display->PlatformDisplay;
> +
> +   /* Check Xlib is running in thread safe mode when running on EGL/X11-xlib
> +    * platform
> +    *
> +    * 'lock_fns' is the XLockDisplay function pointer of the X11 display 'dpy'.
> +    * It wll be NULL if XInitThreads wasn't called.
> +    */
> +   if (display->Platform == _EGL_PLATFORM_X11 && xdpy && !xdpy->lock_fns)
> +      return false;

#ifdef HAVE_WAYLAND_PLATFORM
if (display->Platform == _EGL_PLATFORM_WAYLAND)
   return true;
#endif

Not entirely sure about how DRM/GBM behaves WRT flushing here;
hopefully it works too.

Cheers
Daniel


More information about the mesa-dev mailing list