diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2012-05-28 09:39:51 +0100 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2012-05-28 12:48:25 +0100 |
commit | 45148a714f1461fff898aeb393ad225f081b9bd5 (patch) | |
tree | db7a92619240e15747f146246d0ec278460c1324 /src/sna/sna_dri.c | |
parent | c709f2447dfc6dc36c50ff741d5d9bbdc7c03b58 (diff) |
sna/dri: Enable handling for Option "SwapBuffersWait"
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'src/sna/sna_dri.c')
-rw-r--r-- | src/sna/sna_dri.c | 35 |
1 files changed, 21 insertions, 14 deletions
diff --git a/src/sna/sna_dri.c b/src/sna/sna_dri.c index ee509c05..0f582b5e 100644 --- a/src/sna/sna_dri.c +++ b/src/sna/sna_dri.c @@ -448,7 +448,8 @@ sna_dri_copy_to_front(struct sna *sna, DrawablePtr draw, RegionPtr region, return NULL; } - if (pixmap == sna->front && sync) { + if (pixmap == sna->front && sync && + (sna->flags & SNA_NO_WAIT) == 0) { BoxRec crtc_box; crtc = sna_covering_crtc(sna->scrn, ®ion->extents, @@ -952,6 +953,11 @@ can_flip(struct sna * sna, return FALSE; } + if (sna->flags & SNA_NO_FLIP) { + DBG(("%s: no, pageflips disabled\n", __FUNCTION__)); + return FALSE; + } + if (front->format != back->format) { DBG(("%s: no, format mismatch, front = %d, back = %d\n", __FUNCTION__, front->format, back->format)); @@ -1591,21 +1597,22 @@ sna_dri_schedule_swap(ClientPtr client, DrawablePtr draw, DRI2BufferPtr front, get_private(front)->bo, get_private(back)->bo, true); - - info->type = DRI2_SWAP_THROTTLE; - vbl.request.type = - DRM_VBLANK_RELATIVE | - DRM_VBLANK_NEXTONMISS | - DRM_VBLANK_EVENT; - if (pipe > 0) - vbl.request.type |= DRM_VBLANK_SECONDARY; - vbl.request.sequence = 0; - vbl.request.signal = (unsigned long)info; - if (drmWaitVBlank(sna->kgem.fd, &vbl)) { - sna_dri_frame_event_info_free(info); - DRI2SwapComplete(client, draw, 0, 0, 0, DRI2_BLIT_COMPLETE, func, data); + if ((sna->flags & SNA_NO_WAIT) == 0) { + info->type = DRI2_SWAP_THROTTLE; + vbl.request.type = + DRM_VBLANK_RELATIVE | + DRM_VBLANK_NEXTONMISS | + DRM_VBLANK_EVENT; + if (pipe > 0) + vbl.request.type |= DRM_VBLANK_SECONDARY; + vbl.request.sequence = 0; + vbl.request.signal = (unsigned long)info; + if (drmWaitVBlank(sna->kgem.fd, &vbl) == 0) + return TRUE; } + sna_dri_frame_event_info_free(info); + DRI2SwapComplete(client, draw, 0, 0, 0, DRI2_BLIT_COMPLETE, func, data); return TRUE; } |