Hi,

There should be very few X11 calls while rendering (basically only at the beginning or end of a frame).

Why not just always run these calls in the main thread (and wait for glthread work to finish) ?

That's basically what we do for gallium nine.

Yours,

Axel

On 05/05/2017 17:37, Gregory Hainaut wrote:
Hello Mesa developers,

Following the discussion from
https://lists.freedesktop.org/archives/mesa-dev/2017-April/153137.html

A check was added to ensure that X11 display can be locked. It should be enough
to ensure thread safety between X11 and glthread.

I also did the check on DRI3 as I'm not 100% sure that it is really thread safe.

------------------------------------

v2: based on Nicolai/Matt reviews
Add a check on DRI extension version
Use C comments :)

v3: based on Emil reviews
Split the initial first patch into 3 sub patches dri extension / glx / egl
Improve error message
Improve code readability
Just include libX11 on EGL protected by ifdef

Thanks you for all the review comments.

Best regards,

Gregory Hainaut (4):
   dri: Extend __DRIbackgroundCallableExtensionRec to include a callback
     that checks for thread safety
   glx: implement __DRIbackgroundCallableExtension.isThreadSafe
   egl: implement __DRIbackgroundCallableExtension.isThreadSafe
   glthread/gallium: require safe_glthread to start glthread

  include/GL/internal/dri_interface.h          | 11 +++++++++++
  src/egl/drivers/dri2/egl_dri2.c              | 28 +++++++++++++++++++++++++++-
  src/gallium/state_trackers/dri/dri_context.c | 21 +++++++++++++++++----
  src/glx/dri2_glx.c                           | 15 ++++++++++++++-
  src/glx/dri3_glx.c                           | 15 ++++++++++++++-
  5 files changed, 83 insertions(+), 7 deletions(-)


_______________________________________________
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev

Reply via email to