GLX/OML: honor OML semantics even if target, divisor and remainder are 0
authorJesse Barnes <jbarnes@virtuousgeek.org>
Mon, 22 Mar 2010 23:39:11 +0000 (16:39 -0700)
committerJesse Barnes <jbarnes@virtuousgeek.org>
Mon, 22 Mar 2010 23:41:17 +0000 (16:41 -0700)
This change passes a remainder of 1 to the server with the
DRI2SwapBuffers request, causing it to honor the OML semantics for the
swap rather than falling through to glXSwapBuffers behavior.  The
remainder actually ends up ignored since the divisor is 0, but we need
to differentiate the OML and standard behavior somehow.

Reported-by: Mario Kleiner <mario.kleiner@tuebingen.mpg.de>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
src/glx/glxcmds.c

index 49cbce72f8a279fc2368cbbda17761a75cadde47..ea267f3dd8ace2f2f024ee4eefff0ea4c7e99c5b 100644 (file)
@@ -2507,6 +2507,9 @@ __glXSwapBuffersMscOML(Display * dpy, GLXDrawable drawable,
    if (divisor > 0 && remainder >= divisor)
       return -1;
 
+   if (target_msc == 0 && divisor == 0 && remainder == 0)
+      remainder = 1;
+
 #ifdef __DRI_SWAP_BUFFER_COUNTER
    if (psc->counters != NULL)
       return (*psc->sbc->swapBuffersMSC)(pdraw->driDrawable, target_msc,