vmware/xorg: Do buffer round-robin logic differently
authorJakob Bornecrantz <jakob@vmware.com>
Mon, 25 Jan 2010 11:27:47 +0000 (12:27 +0100)
committerJakob Bornecrantz <jakob@vmware.com>
Mon, 25 Jan 2010 11:27:47 +0000 (12:27 +0100)
src/gallium/winsys/drm/vmware/xorg/vmw_video.c

index b065b96346a9c8aa00a5bd2562a9ba58e59df378..ff3b992d078ff0430eac6b07f174f49b452ff464 100644 (file)
@@ -649,7 +649,8 @@ vmw_video_port_play(ScrnInfoPtr pScrn, struct vmw_video_port *port,
        return XvBadAlloc;
     }
 
-    port->currBuf = ++port->currBuf & (VMWARE_VID_NUM_BUFFERS - 1);
+    if (++(port->currBuf) >= VMWARE_VID_NUM_BUFFERS)
+       port->currBuf = 0;
 
     return Success;
 }