dri3: Return the current swap interval from glXGetSwapIntervalMESA().
authorEric Anholt <eric@anholt.net>
Fri, 29 Mar 2019 17:16:05 +0000 (10:16 -0700)
committerEric Anholt <eric@anholt.net>
Mon, 1 Apr 2019 23:06:38 +0000 (16:06 -0700)
We were caching only the value set with glXSwapIntervalSGI(), missing out
on the default setting of the swap interval by the loader.  This fixes
glxgears's warning about being vblank synchronized by default.

Fixes: 9777c4234b0e ("loader: drop the [gs]et_swap_interval callbacks")
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
src/glx/dri3_glx.c
src/glx/dri3_priv.h

index 9d023341e6b944bb40daf64ff68b6eaef14c128b..8d5b9c2051ecefcef7cd40046e7df44b2545135c 100644 (file)
@@ -649,7 +649,6 @@ dri3_set_swap_interval(__GLXDRIdrawable *pdraw, int interval)
       break;
    }
 
-   priv->swap_interval = interval;
    loader_dri3_set_swap_interval(&priv->loader_drawable, interval);
 
    return 0;
@@ -666,7 +665,7 @@ dri3_get_swap_interval(__GLXDRIdrawable *pdraw)
 
    struct dri3_drawable *priv =  (struct dri3_drawable *) pdraw;
 
-  return priv->swap_interval;
+  return priv->loader_drawable.swap_interval;
 }
 
 static void
index 1d3c03f99973f63c9c9e518c884d8babdd5b2460..32a8d3f7e7df018a1b3bcd06a12b64852e14e79e 100644 (file)
@@ -117,7 +117,6 @@ struct dri3_context
 struct dri3_drawable {
    __GLXDRIdrawable base;
    struct loader_dri3_drawable loader_drawable;
-   int swap_interval;
 
    /* LIBGL_SHOW_FPS support */
    uint64_t previous_ust;