glx: Simplify __glxGetMscRate, it only needs the screen, not a drawable
authorLauri Kasanen <cand@gmx.com>
Sun, 15 Dec 2013 10:37:55 +0000 (12:37 +0200)
committerIan Romanick <ian.d.romanick@intel.com>
Sat, 21 Dec 2013 00:43:08 +0000 (16:43 -0800)
Useful in its own right, but also needed for adaptive vsync.

No regressions in the piglit glx-oml-sync-control-getmscrate test.

Signed-off-by: Lauri Kasanen <cand@gmx.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Tested-by: Ian Romanick <ian.d.romanick@intel.com>
src/glx/dri_common.c
src/glx/glxclient.h
src/glx/glxcmds.c

index 22ba248cfb0022ec63e8f9d41fcbf78ccf15d956..b5058c97c6e583c5b6ab3dc61fff241171243b4f 100644 (file)
@@ -223,7 +223,7 @@ __driGetMSCRate(__DRIdrawable *draw,
 {
    __GLXDRIdrawable *glxDraw = loaderPrivate;
 
-   return __glxGetMscRate(glxDraw, numerator, denominator);
+   return __glxGetMscRate(glxDraw->psc, numerator, denominator);
 }
 
 _X_HIDDEN const __DRIsystemTimeExtension systemTimeExtension = {
index e33dba6a8fb39512f13d64ddf6083888b41f0ca5..a7118af2260256bea1a8ca9dfd196dae323122c8 100644 (file)
@@ -781,7 +781,7 @@ extern GLboolean __glXGetMscRateOML(Display * dpy, GLXDrawable drawable,
 
 #if defined(GLX_DIRECT_RENDERING) && !defined(GLX_USE_APPLEGL)
 extern GLboolean
-__glxGetMscRate(__GLXDRIdrawable *glxDraw,
+__glxGetMscRate(struct glx_screen *psc,
                int32_t * numerator, int32_t * denominator);
 
 /* So that dri2.c:DRI2WireToEvent() can access
index 06c4c16d6af165510eb196f5537e688ccb179095..b5377c29c926bb5331f636ee5e2f58864c7d19e2 100644 (file)
@@ -2095,16 +2095,14 @@ __glXGetSyncValuesOML(Display * dpy, GLXDrawable drawable,
 
 #if defined(GLX_DIRECT_RENDERING) && !defined(GLX_USE_APPLEGL)
 _X_HIDDEN GLboolean
-__glxGetMscRate(__GLXDRIdrawable *glxDraw,
+__glxGetMscRate(struct glx_screen *psc,
                int32_t * numerator, int32_t * denominator)
 {
 #ifdef XF86VIDMODE
-   struct glx_screen *psc;
    XF86VidModeModeLine mode_line;
    int dot_clock;
    int i;
 
-   psc = glxDraw->psc;
    if (XF86VidModeQueryVersion(psc->dpy, &i, &i) &&
        XF86VidModeGetModeLine(psc->dpy, psc->scr, &dot_clock, &mode_line)) {
       unsigned n = dot_clock * 1000;
@@ -2180,7 +2178,7 @@ __glXGetMscRateOML(Display * dpy, GLXDrawable drawable,
    if (draw == NULL)
       return False;
 
-   return __glxGetMscRate(draw, numerator, denominator);
+   return __glxGetMscRate(draw->psc, numerator, denominator);
 #else
    (void) dpy;
    (void) drawable;