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>
This commit is contained in:
Chris Wilson 2012-09-07 12:18:08 +01:00
parent 2630c81937
commit d7879a5939
2 changed files with 9 additions and 2 deletions

View File

@ -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++;
}

View File

@ -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));