xf86-video-intel: src/sna/sna_dri.c
Chris Wilson
ickle at kemper.freedesktop.org
Tue Dec 11 10:53:37 PST 2012
src/sna/sna_dri.c | 32 +++++++++++++++++++-------------
1 file changed, 19 insertions(+), 13 deletions(-)
New commits:
commit 2502218a9340044bb660be68f059971119077e29
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date: Tue Dec 11 17:47:09 2012 +0000
sna/dri: Fix handling of current_msc > target_msc
Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>
diff --git a/src/sna/sna_dri.c b/src/sna/sna_dri.c
index 2e3cd12..e7e5e35 100644
--- a/src/sna/sna_dri.c
+++ b/src/sna/sna_dri.c
@@ -1723,16 +1723,19 @@ sna_dri_schedule_flip(ClientPtr client, DrawablePtr draw, DRI2BufferPtr front,
}
/* Get current count */
- vbl.request.type = DRM_VBLANK_RELATIVE | pipe_select(pipe);
- vbl.request.sequence = 0;
- if (sna_wait_vblank(sna, &vbl))
- return false;
- current_msc = vbl.reply.sequence;
+ if (*target_msc) {
+ vbl.request.type = DRM_VBLANK_RELATIVE | pipe_select(pipe);
+ vbl.request.sequence = 0;
+ if (sna_wait_vblank(sna, &vbl))
+ return false;
+ current_msc = vbl.reply.sequence;
+ } else
+ current_msc = 0;
/* Truncate to match kernel interfaces; means occasional overflow
* misses, but that's generally not a big deal */
divisor &= 0xffffffff;
- if (divisor == 0 && current_msc <= *target_msc) {
+ if (divisor == 0 && current_msc >= *target_msc) {
DBG(("%s: performing immediate swap on pipe %d, pending? %d\n",
__FUNCTION__, pipe, sna->dri.flip_pending != NULL));
@@ -2067,14 +2070,17 @@ sna_dri_schedule_swap(ClientPtr client, DrawablePtr draw, DRI2BufferPtr front,
info->type = swap_type;
- /* Get current count */
- vbl.request.type = DRM_VBLANK_RELATIVE | pipe_select(pipe);
- vbl.request.sequence = 0;
- if (sna_wait_vblank(sna, &vbl))
- goto blit_fallback;
- current_msc = vbl.reply.sequence;
+ if (*target_msc) {
+ /* Get current count */
+ vbl.request.type = DRM_VBLANK_RELATIVE | pipe_select(pipe);
+ vbl.request.sequence = 0;
+ if (sna_wait_vblank(sna, &vbl))
+ goto blit_fallback;
+ current_msc = vbl.reply.sequence;
+ } else
+ current_msc = 0;
- if (divisor == 0 && current_msc <= *target_msc) {
+ if (divisor == 0 && current_msc >= *target_msc) {
if (can_exchange(sna, draw, front, back)) {
sna_dri_immediate_xchg(sna, draw, info);
} else if (can_blit(sna, draw, front, back)) {
More information about the xorg-commit
mailing list