summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJesse Barnes <jbarnes@virtuousgeek.org>2010-01-13 13:20:43 -0500
committerJesse Barnes <jbarnes@virtuousgeek.org>2010-01-13 13:25:45 -0500
commit96f45c66eed2631eba98ae416c3afdf540fa5c34 (patch)
tree1efcf4119d1e9c71e31df4b056a1e0c8a093817f
parent51c75906329a4727e37c8d1f64f257ea9602caa2 (diff)
DRI2: if the swap condition is satisfied, complete it immediately
If we get to the point where we check the divisor/remainder equation and it's satisfied, we should complete the swap immediately. Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
-rw-r--r--src/i830_dri.c20
1 files changed, 18 insertions, 2 deletions
diff --git a/src/i830_dri.c b/src/i830_dri.c
index e1c14701..ed9d69f6 100644
--- a/src/i830_dri.c
+++ b/src/i830_dri.c
@@ -669,8 +669,24 @@ I830DRI2ScheduleSwap(ClientPtr client, DrawablePtr draw, DRI2BufferPtr front,
* If we get here, target_msc has already passed or we don't have one,
* so we queue an event that will satisfy the divisor/remainderequation.
*/
- if ((vbl.reply.sequence % divisor) == remainder)
- return FALSE;
+ if ((vbl.reply.sequence % divisor) == remainder) {
+ BoxRec box;
+ RegionRec region;
+
+ box.x1 = 0;
+ box.y1 = 0;
+ box.x2 = draw->width;
+ box.y2 = draw->height;
+ REGION_INIT(pScreen, &region, &box, 0);
+
+ I830DRI2CopyRegion(draw, &region, front, back);
+
+ DRI2SwapComplete(client, draw, 0, 0, 0, DRI2_BLIT_COMPLETE, func,
+ data);
+ if (swap_info)
+ xfree(swap_info);
+ return TRUE;
+ }
vbl.request.type = DRM_VBLANK_ABSOLUTE | DRM_VBLANK_EVENT;
if (pipe > 0)