Mesa (master): dri3: Return the current swap interval from glXGetSwapIntervalMESA().

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Mon Apr 1 23:07:25 UTC 2019


Module: Mesa
Branch: master
Commit: edc7deec42bc5f97d0eae9f910d79c6bc31e05ce
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=edc7deec42bc5f97d0eae9f910d79c6bc31e05ce

Author: Eric Anholt <eric at anholt.net>
Date:   Fri Mar 29 10:16:05 2019 -0700

dri3: Return the current swap interval from glXGetSwapIntervalMESA().

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 at intel.com>

---

 src/glx/dri3_glx.c  | 3 +--
 src/glx/dri3_priv.h | 1 -
 2 files changed, 1 insertion(+), 3 deletions(-)

diff --git a/src/glx/dri3_glx.c b/src/glx/dri3_glx.c
index 9d023341e6b..8d5b9c2051e 100644
--- a/src/glx/dri3_glx.c
+++ b/src/glx/dri3_glx.c
@@ -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
diff --git a/src/glx/dri3_priv.h b/src/glx/dri3_priv.h
index 1d3c03f9997..32a8d3f7e7d 100644
--- a/src/glx/dri3_priv.h
+++ b/src/glx/dri3_priv.h
@@ -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;




More information about the mesa-commit mailing list