summaryrefslogtreecommitdiff
path: root/src/sna/sna_dri2.c
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2016-02-23 14:36:10 +0000
committerChris Wilson <chris@chris-wilson.co.uk>2016-02-23 14:36:10 +0000
commit3593a2d18928f74ee470f824dc34b8b5b148ce2d (patch)
tree22460078a037aaa9d632807f1d93838bbcd87aff /src/sna/sna_dri2.c
parent64b1b1f10da59f15a91141c9f76d7d09517f8ea8 (diff)
sna/dri2: Reset front pointer on frame event across a modeset
If the root window's pixmap is changed (e.g. to resizing the framebuffer) then an outstanding flip becomes invalid. The invalid flip is marked as having a stale front, and that triggers an assertion if the user then tries to schedule flip before the pending flip event is processed. References: https://bugs.freedesktop.org/show_bug.cgi?id=9425 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.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/sna/sna_dri2.c b/src/sna/sna_dri2.c
index 9398c0a8..2fcda876 100644
--- a/src/sna/sna_dri2.c
+++ b/src/sna/sna_dri2.c
@@ -3075,8 +3075,11 @@ sna_dri2_schedule_flip(ClientPtr client, DrawablePtr draw, xf86CrtcPtr crtc,
if (info && info->draw == draw) {
assert(info->type != FLIP);
- assert(info->front == front);
assert(info->queued);
+ if (info->front != front) {
+ assert(info->front == NULL);
+ info->front = sna_dri2_reference_buffer(front);
+ }
if (info->back != back) {
_sna_dri2_destroy_buffer(sna, draw, info->back);
info->back = sna_dri2_reference_buffer(back);
@@ -3129,6 +3132,7 @@ sna_dri2_schedule_flip(ClientPtr client, DrawablePtr draw, xf86CrtcPtr crtc,
info->type = use_triple_buffer(sna, client, *target_msc == 0);
if (!sna_dri2_flip(info)) {
DBG(("%s: flip failed, falling back\n", __FUNCTION__));
+ info->signal = false;
sna_dri2_event_free(info);
return false;
}
@@ -3179,6 +3183,7 @@ queue:
/* Account for 1 frame extra pageflip delay */
if (!sna_wait_vblank(info,
draw_target_seq(draw, *target_msc - 1))) {
+ info->signal = false;
sna_dri2_event_free(info);
return false;
}