[Mesa-dev] [PATCH 1/2] glx: Ensure that glXWaitX actually waits for X.

Ian Romanick idr at freedesktop.org
Tue May 7 10:55:26 PDT 2013


On 05/06/2013 05:39 PM, Eric Anholt wrote:
> Ever since fake front was introduced in
> 63b51b5cf17ddde09b72a2811296f37b9a4c5ad2, we were skipping the XSync() in
> the non-fake-front path, so compositors like Firefox's GL canvas were
> having to manually put it in outside of glXWaitX().
>
> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=52930

Both patches are

Reviewed-by: Ian Romanick <ian.d.romanick at intel.com>

and

NOTE: This is a candidate for the stable branches.

It might be worth adding the bit about pixmaps from the second commit 
message to this one as well.  I was unsure how you'd hit this problem 
until I read the second patch.

> ---
>   src/glx/dri2_glx.c | 21 +++++++++++++++++----
>   1 file changed, 17 insertions(+), 4 deletions(-)
>
> diff --git a/src/glx/dri2_glx.c b/src/glx/dri2_glx.c
> index 7ce5775..3cdd249 100644
> --- a/src/glx/dri2_glx.c
> +++ b/src/glx/dri2_glx.c
> @@ -639,10 +639,23 @@ dri2_wait_x(struct glx_context *gc)
>      struct dri2_drawable *priv = (struct dri2_drawable *)
>         GetGLXDRIDrawable(gc->currentDpy, gc->currentDrawable);
>
> -   if (priv == NULL || !priv->have_fake_front)
> -      return;
> -
> -   dri2_copy_drawable(priv, DRI2BufferFakeFrontLeft, DRI2BufferFrontLeft);
> +   if (priv != NULL && priv->have_fake_front) {
> +      /* Ask the server to update our copy of the front buffer from the real
> +       * front buffer.  This will round-trip with the server, so we can skip
> +       * the XSync().
> +       */
> +      dri2_copy_drawable(priv, DRI2BufferFakeFrontLeft, DRI2BufferFrontLeft);
> +   } else {
> +      /* From the GLX 1.4 spec, page 33:
> +       *
> +       *     "X rendering calls made prior to glXWaitX are guaranteed to be
> +       *      executed before OpenGL rendering calls made after
> +       *      glXWaitX. While the same result can be achieved using XSync,
> +       *      glXWaitX does not require a round trip to the server, and may
> +       *      therefore be more efficient."
> +       */
> +      XSync(gc->currentDpy, False);
> +   }
>   }
>
>   static void
>



More information about the mesa-dev mailing list