aboutsummaryrefslogtreecommitdiffstats
path: root/src/glx
diff options
context:
space:
mode:
authorLauri Kasanen <[email protected]>2013-12-15 12:37:55 +0200
committerIan Romanick <[email protected]>2013-12-20 16:43:08 -0800
commitfe2079c4c014934d1a5dbc87733742fea5a619da (patch)
tree8ce123d05842148e8b9ed84bcf442dd3b52020d5 /src/glx
parent6b5111398110f9ae374723ad6225ada1a0e60fd2 (diff)
glx: Simplify __glxGetMscRate, it only needs the screen, not a drawable
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 <[email protected]> Reviewed-by: Ian Romanick <[email protected]> Tested-by: Ian Romanick <[email protected]>
Diffstat (limited to 'src/glx')
-rw-r--r--src/glx/dri_common.c2
-rw-r--r--src/glx/glxclient.h2
-rw-r--r--src/glx/glxcmds.c6
3 files changed, 4 insertions, 6 deletions
diff --git a/src/glx/dri_common.c b/src/glx/dri_common.c
index 22ba248cfb0..b5058c97c6e 100644
--- a/src/glx/dri_common.c
+++ b/src/glx/dri_common.c
@@ -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 = {
diff --git a/src/glx/glxclient.h b/src/glx/glxclient.h
index e33dba6a8fb..a7118af2260 100644
--- a/src/glx/glxclient.h
+++ b/src/glx/glxclient.h
@@ -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
diff --git a/src/glx/glxcmds.c b/src/glx/glxcmds.c
index 06c4c16d6af..b5377c29c92 100644
--- a/src/glx/glxcmds.c
+++ b/src/glx/glxcmds.c
@@ -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;