summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2012-09-07 12:18:08 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2012-09-07 12:18:08 +0100
commitd7879a5939cabcd8b804e19fc422d2022ab7e3a4 (patch)
treef2406da82febdb5034d1b83f5dcd5dde1d397320
parent2630c81937115602faa352fca369d89fbb926b33 (diff)
sna/dri: Fix the double-buffer pageflipping path
Notably, we need to remember to exchange the front/back buffers after flipping! Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
-rw-r--r--src/sna/sna_display.c7
-rw-r--r--src/sna/sna_dri.c4
2 files changed, 9 insertions, 2 deletions
diff --git a/src/sna/sna_display.c b/src/sna/sna_display.c
index 5d906539..bde296d2 100644
--- a/src/sna/sna_display.c
+++ b/src/sna/sna_display.c
@@ -132,6 +132,7 @@ static unsigned get_fb(struct sna *sna, struct kgem_bo *bo,
ScrnInfoPtr scrn = sna->scrn;
struct drm_mode_fb_cmd arg;
+ assert(bo->refcnt);
assert(bo->proxy == NULL);
if (bo->delta) {
DBG(("%s: reusing fb=%d for handle=%d\n",
@@ -2371,8 +2372,10 @@ disable:
continue;
}
- kgem_bo_destroy(&sna->kgem, crtc->bo);
- crtc->bo = kgem_bo_reference(bo);
+ if (crtc->bo != bo) {
+ kgem_bo_destroy(&sna->kgem, crtc->bo);
+ crtc->bo = kgem_bo_reference(bo);
+ }
count++;
}
diff --git a/src/sna/sna_dri.c b/src/sna/sna_dri.c
index de84ac73..8dc2f01e 100644
--- a/src/sna/sna_dri.c
+++ b/src/sna/sna_dri.c
@@ -1567,6 +1567,10 @@ sna_dri_schedule_flip(ClientPtr client, DrawablePtr draw, DRI2BufferPtr front,
DRI2_EXCHANGE_COMPLETE,
info->event_complete,
info->event_data);
+ } else {
+ info->back->name = info->old_front.name;
+ get_private(info->back)->bo = info->old_front.bo;
+ info->old_front.bo = NULL;
}
} else {
info = calloc(1, sizeof(struct sna_dri_frame_event));