diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2012-12-10 20:09:22 +0000 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2012-12-10 23:07:38 +0000 |
commit | 0c2287c735f990a98b39d00f28168d7a5df25aba (patch) | |
tree | 5f0c91abb0c5288cdd6bc2bc332716e0ae250504 | |
parent | 2ab29a1688cd313768d928e87e145570f35b4a70 (diff) | |
download | xf86-video-intel-0c2287c735f990a98b39d00f28168d7a5df25aba.tar.gz xf86-video-intel-0c2287c735f990a98b39d00f28168d7a5df25aba.tar.bz2 xf86-video-intel-0c2287c735f990a98b39d00f28168d7a5df25aba.zip |
sna/dri: Only special case 'divisor && msc-passed' for immediate flipping
As Jesse pointed out, it is legal for the client to request that the
flip be some frame in the future even with no divisor.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
-rw-r--r-- | src/sna/sna_dri.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/sna/sna_dri.c b/src/sna/sna_dri.c index 445399704..2ff138f9b 100644 --- a/src/sna/sna_dri.c +++ b/src/sna/sna_dri.c @@ -1719,7 +1719,7 @@ sna_dri_schedule_flip(ClientPtr client, DrawablePtr draw, DRI2BufferPtr front, /* Truncate to match kernel interfaces; means occasional overflow * misses, but that's generally not a big deal */ divisor &= 0xffffffff; - if (divisor == 0) { + 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)); @@ -1848,6 +1848,9 @@ sna_dri_schedule_flip(ClientPtr client, DrawablePtr draw, DRI2BufferPtr front, (int)*target_msc, (int)divisor)); + if (divisor == 0) + divisor = 1; + vbl.request.sequence = current_msc - current_msc % divisor + remainder; /* @@ -2059,7 +2062,7 @@ sna_dri_schedule_swap(ClientPtr client, DrawablePtr draw, DRI2BufferPtr front, sna_dri_reference_buffer(back); info->type = swap_type; - if (divisor == 0) { + 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)) { @@ -2117,6 +2120,9 @@ sna_dri_schedule_swap(ClientPtr client, DrawablePtr draw, DRI2BufferPtr front, (int)*target_msc, (int)divisor)); + if (divisor == 0) + divisor = 1; + vbl.request.type = DRM_VBLANK_ABSOLUTE | DRM_VBLANK_EVENT | |