xf86-video-intel: src/sna/sna_display.c src/sna/sna_dri.c

Chris Wilson ickle at kemper.freedesktop.org
Fri Sep 7 04:18:22 PDT 2012


 src/sna/sna_display.c |    7 +++++--
 src/sna/sna_dri.c     |    4 ++++
 2 files changed, 9 insertions(+), 2 deletions(-)

New commits:
commit d7879a5939cabcd8b804e19fc422d2022ab7e3a4
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Fri Sep 7 12:18:08 2012 +0100

    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 at chris-wilson.co.uk>

diff --git a/src/sna/sna_display.c b/src/sna/sna_display.c
index 5d90653..bde296d 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 de84ac7..8dc2f01 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));


More information about the xorg-commit mailing list