summaryrefslogtreecommitdiff
path: root/src/sna/sna_dri2.c
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2015-08-16 13:31:16 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2015-08-16 13:31:16 +0100
commit9b0ed16385ae076c262a2e09639822d9488ccf57 (patch)
tree5cd6df26b00a8e6c4a877ace197293089c8e2527 /src/sna/sna_dri2.c
parent521b2c5a3b29a399b4b32b027eeb097accd4b3dd (diff)
sna/dri2: Flush the pending flip when a client disappears
If a client dies with a pending flip, we have to complete it so that the scanout matches the frontbuffer again. This requires one last flip following the client disapparance. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'src/sna/sna_dri2.c')
-rw-r--r--src/sna/sna_dri2.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/src/sna/sna_dri2.c b/src/sna/sna_dri2.c
index 22456f26..8e1a46de 100644
--- a/src/sna/sna_dri2.c
+++ b/src/sna/sna_dri2.c
@@ -1577,7 +1577,6 @@ sna_dri2_client_gone(CallbackListPtr *list, void *closure, void *data)
event);
event->client = NULL;
event->draw = NULL;
- event->flip_continue = 0;
list_del(&event->link);
} else
sna_dri2_event_free(event);
@@ -1699,7 +1698,6 @@ void sna_dri2_destroy_window(WindowPtr win)
assert(info->draw == &win->drawable);
info->draw = NULL;
info->client = NULL;
- info->flip_continue = 0;
list_del(&info->link);
chain = info->chain;
@@ -2746,8 +2744,8 @@ sna_dri2_flip_continue(struct sna_dri2_event *info)
DBG(("%s(mode=%d)\n", __FUNCTION__, info->flip_continue));
assert(info->flip_continue > 0);
-
info->type = info->flip_continue;
+ info->flip_continue = 0;
if (info->sna->mode.front_active == 0)
return false;
@@ -2763,7 +2761,6 @@ sna_dri2_flip_continue(struct sna_dri2_event *info)
info->sna->dri2.flip_pending = info;
assert(info->queued);
- info->flip_continue = 0;
return true;
}
@@ -2778,6 +2775,7 @@ sna_dri2_flip_keepalive(struct sna_dri2_event *info)
if (info->draw == NULL)
return false;
+ DBG(("%s: marking next flip as complete\n", __FUNCTION__));
info->flip_continue = FLIP_COMPLETE;
return sna_dri2_flip_continue(info);
}
@@ -3031,15 +3029,14 @@ sna_dri2_schedule_flip(ClientPtr client, DrawablePtr draw, xf86CrtcPtr crtc,
_sna_dri2_destroy_buffer(sna, draw, info->back);
info->back = sna_dri2_reference_buffer(back);
}
- DBG(("%s: executing xchg of pending flip: flip_continue=%d, keepalive=%d\n", __FUNCTION__, info->flip_continue, info->keepalive));
+ DBG(("%s: executing xchg of pending flip: flip_continue=%d, keepalive=%d, chain?=%d\n", __FUNCTION__, info->flip_continue, info->keepalive, current_msc < *target_msc));
sna_dri2_xchg(draw, front, back);
+ info->flip_continue = FLIP_COMPLETE;
info->keepalive++;
if (xorg_can_triple_buffer() &&
- !info->flip_continue &&
current_msc < *target_msc) {
DBG(("%s: chaining flip\n", __FUNCTION__));
info->type = FLIP_THROTTLE;
- info->flip_continue = FLIP_COMPLETE;
goto out;
} else
goto new_back;