From 89e8f2b35bbbcaac23dd1d3fc42e83d8214a9130 Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Fri, 16 May 2014 10:14:57 +0100 Subject: [PATCH] sna/dri2: Update the swap type for chained flips We stash the pending flip mode into the closure, but failed to copy that over to the right field when continuing with a chain of flips. The impact was that we would fail to issue the required SwapComplete to unblock the clients. Fixes regression from commit 96ce362ba40bf9560fb1aa27a6ae5fdd2a8bd428 Author: Chris Wilson Date: Tue May 13 09:46:45 2014 +0100 sna/dri2: Do not rate-limit vblank=0 swaps Reported-by: francisbrwn Signed-off-by: Chris Wilson --- src/sna/sna_dri2.c | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/src/sna/sna_dri2.c b/src/sna/sna_dri2.c index 6c7f84a2..68299b7f 100644 --- a/src/sna/sna_dri2.c +++ b/src/sna/sna_dri2.c @@ -1303,8 +1303,8 @@ static void fake_swap_complete(struct sna *sna, ClientPtr client, DrawablePtr draw, int type, DRI2SwapEventPtr func, void *data) { - DBG(("%s: frame=%d, tv=%d.%06d\n", __FUNCTION__, - sna->dri2.last_swap[0].msc, + DBG(("%s: frame=%lld, tv=%d.%06d\n", __FUNCTION__, + (long long)sna->dri2.last_swap[0].msc, sna->dri2.last_swap[0].tv_sec, sna->dri2.last_swap[0].tv_usec)); DRI2SwapComplete(client, draw, @@ -1657,6 +1657,8 @@ sna_dri2_flip_continue(struct sna *sna, struct sna_dri2_frame_event *info) DBG(("%s(mode=%d)\n", __FUNCTION__, info->mode)); if (info->mode > 0){ + info->type = info->mode; + if (get_private(info->front)->bo != sna_pixmap(sna->front)->gpu_bo) return false; @@ -1672,9 +1674,9 @@ sna_dri2_flip_continue(struct sna *sna, struct sna_dri2_frame_event *info) info->scanout[0].name = info->front->name; assert(info->scanout[0].bo->scanout); sna->dri2.flip_pending = info; - - info->type = info->mode; } else { + info->type = -info->mode; + if (!info->draw) return false; @@ -1904,11 +1906,11 @@ get_current_msc(struct sna *sna, int pipe) vbl.request.type = DRM_VBLANK_RELATIVE | pipe_select(pipe); vbl.request.sequence = 0; if (sna_wait_vblank(sna, &vbl, pipe) == 0) { - DBG(("%s: recording last swap on pipe=%d, frame %d, time %d.%06d\n", + DBG(("%s: recording last swap on pipe=%d, frame %lld, time %ld.%06ld\n", __FUNCTION__, pipe, - vbl.reply.sequence, - vbl.reply.tval_sec, - vbl.reply.tval_usec)); + (long long)vbl.reply.sequence, + (long)vbl.reply.tval_sec, + (long)vbl.reply.tval_usec)); sna->dri2.last_swap[pipe].tv_sec = vbl.reply.tval_sec; sna->dri2.last_swap[pipe].tv_usec = vbl.reply.tval_usec; sna->dri2.last_swap[pipe].msc = vbl.reply.sequence; @@ -2398,11 +2400,11 @@ fail: vbl.request.type = DRM_VBLANK_RELATIVE; vbl.request.sequence = 0; if (sna_wait_vblank(sna, &vbl, pipe) == 0) { - DBG(("%s: recording last swap on pipe=%d, frame %d, time %d.%06d\n", + DBG(("%s: recording last swap on pipe=%d, frame %lld, time %ld.%06ld\n", __FUNCTION__, pipe, - vbl.reply.sequence, - vbl.reply.tval_sec, - vbl.reply.tval_usec)); + (long long)vbl.reply.sequence, + (long)vbl.reply.tval_sec, + (long)vbl.reply.tval_usec)); sna->dri2.last_swap[pipe].tv_sec = vbl.reply.tval_sec; sna->dri2.last_swap[pipe].tv_usec = vbl.reply.tval_usec; sna->dri2.last_swap[pipe].msc = vbl.reply.sequence;