summaryrefslogtreecommitdiff
path: root/src/glx/glxcmds.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/glx/glxcmds.c')
-rw-r--r--src/glx/glxcmds.c62
1 files changed, 59 insertions, 3 deletions
diff --git a/src/glx/glxcmds.c b/src/glx/glxcmds.c
index ea267f3dd8..7cdd42caf0 100644
--- a/src/glx/glxcmds.c
+++ b/src/glx/glxcmds.c
@@ -1917,6 +1917,7 @@ __glXSwapIntervalSGI(int interval)
#endif
psc = GetGLXScreenConfigs( gc->currentDpy, gc->screen);
+#ifdef GLX_DIRECT_RENDERING
if (gc->driContext && psc->driScreen && psc->driScreen->setSwapInterval) {
__GLXDRIdrawable *pdraw = GetGLXDRIDrawable(gc->currentDpy,
gc->currentDrawable,
@@ -1924,6 +1925,7 @@ __glXSwapIntervalSGI(int interval)
psc->driScreen->setSwapInterval(pdraw, interval);
return 0;
}
+#endif
dpy = gc->currentDpy;
opcode = __glXSetupForCommand(dpy);
@@ -1974,6 +1976,7 @@ __glXSwapIntervalMESA(unsigned int interval)
}
#endif
+#ifdef GLX_DIRECT_RENDERING
if (gc != NULL && gc->driContext) {
__GLXscreenConfigs *psc;
@@ -1985,6 +1988,7 @@ __glXSwapIntervalMESA(unsigned int interval)
return 0;
}
}
+#endif
return GLX_BAD_CONTEXT;
}
@@ -2009,6 +2013,8 @@ __glXGetSwapIntervalMESA(void)
}
}
#endif
+
+#ifdef GLX_DIRECT_RENDERING
if (gc != NULL && gc->driContext) {
__GLXscreenConfigs *psc;
@@ -2019,6 +2025,7 @@ __glXGetSwapIntervalMESA(void)
return psc->driScreen->getSwapInterval(pdraw);
}
}
+#endif
return 0;
}
@@ -2135,13 +2142,22 @@ __glXGetVideoSyncSGI(unsigned int *count)
int ret;
GLXContext gc = __glXGetCurrentContext();
__GLXscreenConfigs *psc;
+#ifdef GLX_DIRECT_RENDERING
__GLXDRIdrawable *pdraw;
+#endif
- if (!gc || !gc->driContext)
+ if (!gc)
return GLX_BAD_CONTEXT;
+#ifdef GLX_DIRECT_RENDERING
+ if (!gc->driContext)
+ return GLX_BAD_CONTEXT;
+#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
@@ -2156,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;
}
@@ -2170,18 +2189,27 @@ __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;
if (divisor <= 0 || remainder < 0)
return GLX_BAD_VALUE;
- if (!gc || !gc->driContext)
+ if (!gc)
return GLX_BAD_CONTEXT;
+#ifdef GLX_DIRECT_RENDERING
+ if (!gc->driContext)
+ return GLX_BAD_CONTEXT;
+#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 ) {
@@ -2191,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;
}
@@ -2354,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)
@@ -2370,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;
}
@@ -2491,12 +2529,19 @@ __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 || !gc->driContext) /* no GLX for this */
+ if (!gc) /* no GLX for this */
return -1;
+#ifdef GLX_DIRECT_RENDERING
+ if (!pdraw || !gc->driContext)
+ return -1;
+#endif
+
/* The OML_sync_control spec says these should "generate a GLX_BAD_VALUE
* error", but it also says "It [glXSwapBuffersMscOML] will return a value
* of -1 if the function failed because of errors detected in the input
@@ -2533,7 +2578,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;
@@ -2557,11 +2604,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;
}
@@ -2573,7 +2623,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;
@@ -2593,10 +2645,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;
}