summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/glx/glxcmds.c41
1 files changed, 39 insertions, 2 deletions
diff --git a/src/glx/glxcmds.c b/src/glx/glxcmds.c
index 8f809dc5259..51a75e352bb 100644
--- a/src/glx/glxcmds.c
+++ b/src/glx/glxcmds.c
@@ -2013,6 +2013,8 @@ __glXGetSwapIntervalMESA(void)
}
}
#endif
+
+#ifdef GLX_DIRECT_RENDERING
if (gc != NULL && gc->driContext) {
__GLXscreenConfigs *psc;
@@ -2023,6 +2025,7 @@ __glXGetSwapIntervalMESA(void)
return psc->driScreen->getSwapInterval(pdraw);
}
}
+#endif
return 0;
}
@@ -2139,7 +2142,9 @@ __glXGetVideoSyncSGI(unsigned int *count)
int ret;
GLXContext gc = __glXGetCurrentContext();
__GLXscreenConfigs *psc;
+#ifdef GLX_DIRECT_RENDERING
__GLXDRIdrawable *pdraw;
+#endif
if (!gc)
return GLX_BAD_CONTEXT;
@@ -2150,7 +2155,9 @@ __glXGetVideoSyncSGI(unsigned int *count)
#endif
psc = GetGLXScreenConfigs(gc->currentDpy, gc->screen);
+#ifdef GLX_DIRECT_RENDERING
pdraw = GetGLXDRIDrawable(gc->currentDpy, gc->currentDrawable, NULL);
+#endif
/* FIXME: Looking at the GLX_SGI_video_sync spec in the extension registry,
* FIXME: there should be a GLX encoding for this call. I can find no
@@ -2165,11 +2172,14 @@ __glXGetVideoSyncSGI(unsigned int *count)
return (ret == 0) ? 0 : GLX_BAD_CONTEXT;
}
#endif
+
+#ifdef GLX_DIRECT_RENDERING
if (psc->driScreen && psc->driScreen->getDrawableMSC) {
ret = psc->driScreen->getDrawableMSC(psc, pdraw, &ust, &msc, &sbc);
*count = (unsigned) msc;
return (ret == True) ? 0 : GLX_BAD_CONTEXT;
}
+#endif
return GLX_BAD_CONTEXT;
}
@@ -2179,7 +2189,9 @@ __glXWaitVideoSyncSGI(int divisor, int remainder, unsigned int *count)
{
GLXContext gc = __glXGetCurrentContext();
__GLXscreenConfigs *psc;
+#ifdef GLX_DIRECT_RENDERING
__GLXDRIdrawable *pdraw;
+#endif
int64_t ust, msc, sbc;
int ret;
@@ -2195,7 +2207,9 @@ __glXWaitVideoSyncSGI(int divisor, int remainder, unsigned int *count)
#endif
psc = GetGLXScreenConfigs( gc->currentDpy, gc->screen);
+#ifdef GLX_DIRECT_RENDERING
pdraw = GetGLXDRIDrawable(gc->currentDpy, gc->currentDrawable, NULL);
+#endif
#ifdef __DRI_MEDIA_STREAM_COUNTER
if (psc->msc != NULL && psc->driScreen ) {
@@ -2205,12 +2219,15 @@ __glXWaitVideoSyncSGI(int divisor, int remainder, unsigned int *count)
return (ret == 0) ? 0 : GLX_BAD_CONTEXT;
}
#endif
+
+#ifdef GLX_DIRECT_RENDERING
if (psc->driScreen && psc->driScreen->waitForMSC) {
ret = psc->driScreen->waitForMSC(pdraw, 0, divisor, remainder, &ust, &msc,
&sbc);
*count = (unsigned) msc;
return (ret == True) ? 0 : GLX_BAD_CONTEXT;
}
+#endif
return GLX_BAD_CONTEXT;
}
@@ -2368,13 +2385,17 @@ __glXGetSyncValuesOML(Display * dpy, GLXDrawable drawable,
{
__GLXdisplayPrivate * const priv = __glXInitialize(dpy);
int i, ret;
+#ifdef GLX_DIRECT_RENDERING
__GLXDRIdrawable *pdraw;
+#endif
__GLXscreenConfigs *psc;
if (!priv)
return False;
+#ifdef GLX_DIRECT_RENDERING
pdraw = GetGLXDRIDrawable(dpy, drawable, &i);
+#endif
psc = &priv->screenConfigs[i];
#if defined(__DRI_SWAP_BUFFER_COUNTER) && defined(__DRI_MEDIA_STREAM_COUNTER)
@@ -2384,10 +2405,13 @@ __glXGetSyncValuesOML(Display * dpy, GLXDrawable drawable,
&& ((*psc->sbc->getSBC)(pdraw->driDrawable, sbc) == 0)
&& (__glXGetUST(ust) == 0) );
#endif
+
+#ifdef GLX_DIRECT_RENDERING
if (pdraw && psc && psc->driScreen && psc->driScreen->getDrawableMSC) {
ret = psc->driScreen->getDrawableMSC(psc, pdraw, ust, msc, sbc);
return ret;
}
+#endif
return False;
}
@@ -2505,14 +2529,16 @@ __glXSwapBuffersMscOML(Display * dpy, GLXDrawable drawable,
{
GLXContext gc = __glXGetCurrentContext();
int screen;
+#ifdef GLX_DIRECT_RENDERING
__GLXDRIdrawable *pdraw = GetGLXDRIDrawable(dpy, drawable, &screen);
+#endif
__GLXscreenConfigs *const psc = GetGLXScreenConfigs(dpy, screen);
- if (!pdraw || !gc) /* no GLX for this */
+ if (!gc) /* no GLX for this */
return -1;
#ifdef GLX_DIRECT_RENDERING
- if (!gc->driContext)
+ if (!pdraw || !gc->driContext)
return -1;
#endif
@@ -2549,7 +2575,9 @@ __glXWaitForMscOML(Display * dpy, GLXDrawable drawable,
int64_t * msc, int64_t * sbc)
{
int screen;
+#ifdef GLX_DIRECT_RENDERING
__GLXDRIdrawable *pdraw = GetGLXDRIDrawable(dpy, drawable, &screen);
+#endif
__GLXscreenConfigs * const psc = GetGLXScreenConfigs( dpy, screen );
int ret;
@@ -2573,11 +2601,14 @@ __glXWaitForMscOML(Display * dpy, GLXDrawable drawable,
return ((ret == 0) && (__glXGetUST(ust) == 0));
}
#endif
+
+#ifdef GLX_DIRECT_RENDERING
if (pdraw && psc->driScreen && psc->driScreen->waitForMSC) {
ret = psc->driScreen->waitForMSC(pdraw, target_msc, divisor, remainder,
ust, msc, sbc);
return ret;
}
+#endif
return False;
}
@@ -2589,7 +2620,9 @@ __glXWaitForSbcOML(Display * dpy, GLXDrawable drawable,
int64_t * msc, int64_t * sbc)
{
int screen;
+#ifdef GLX_DIRECT_RENDERING
__GLXDRIdrawable *pdraw = GetGLXDRIDrawable(dpy, drawable, &screen);
+#endif
__GLXscreenConfigs *const psc = GetGLXScreenConfigs(dpy, screen);
int ret;
@@ -2609,10 +2642,14 @@ __glXWaitForSbcOML(Display * dpy, GLXDrawable drawable,
return ((ret == 0) && (__glXGetUST(ust) == 0));
}
#endif
+
+#ifdef GLX_DIRECT_RENDERING
if (pdraw && psc->driScreen && psc->driScreen->waitForSBC) {
ret = psc->driScreen->waitForSBC(pdraw, target_sbc, ust, msc, sbc);
return ret;
}
+#endif
+
return False;
}