xf86-video-intel: 2 commits - src/sna/sna_display.c test/present-speed.c

Chris Wilson ickle at kemper.freedesktop.org
Mon Apr 6 03:49:42 PDT 2015


 src/sna/sna_display.c |   39 ++++++++++++++++++++++++---------------
 test/present-speed.c  |    6 +++---
 2 files changed, 27 insertions(+), 18 deletions(-)

New commits:
commit a00ed98131d0316d8be1c6c850667d04be397e5a
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Mon Apr 6 11:16:39 2015 +0100

    test/present-speed: Disable idle event reporting for no-copy overhead test
    
    Reduce the overheads in the server for better measurements.
    
    Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>

diff --git a/test/present-speed.c b/test/present-speed.c
index 48964f7..ba06264 100644
--- a/test/present-speed.c
+++ b/test/present-speed.c
@@ -207,8 +207,8 @@ static void run(Display *dpy, Window win, const char *name, unsigned options)
 
 	eid = xcb_generate_id(c);
 	xcb_present_select_input(c, eid, win,
-				 XCB_PRESENT_EVENT_MASK_IDLE_NOTIFY |
-				 XCB_PRESENT_EVENT_MASK_COMPLETE_NOTIFY);
+                                 (options & NOCOPY ? 0 : XCB_PRESENT_EVENT_MASK_IDLE_NOTIFY) |
+                                 XCB_PRESENT_EVENT_MASK_COMPLETE_NOTIFY);
 	Q = xcb_register_for_special_xge(c, &xcb_present_id, eid, &stamp);
 
 	clock_gettime(CLOCK_MONOTONIC, &start);
@@ -251,7 +251,7 @@ static void run(Display *dpy, Window win, const char *name, unsigned options)
 			}
 			assert(p);
 
-			b->busy = 1;
+			b->busy = (options & NOCOPY) == 0;
 			if (b->fence.xid) {
 				xshmfence_await(b->fence.addr);
 				xshmfence_reset(b->fence.addr);
commit c2da68871a33612abd8a4fddbabec6118c6ea1be
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Mon Apr 6 09:52:59 2015 +0100

    sna: Clear the new scanout along all paths before attaching
    
    Make sure we clear the scanout even after the error paths before
    attaching the shadow buffer (in case it is full of unwanted junk).
    
    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 6f69619..eacfe14 100644
--- a/src/sna/sna_display.c
+++ b/src/sna/sna_display.c
@@ -1995,6 +1995,22 @@ get_scanout_bo(struct sna *sna, PixmapPtr pixmap)
 	return priv->gpu_bo;
 }
 
+static void clear(struct sna *sna,
+		  PixmapPtr front, struct kgem_bo *bo,
+		  xf86CrtcPtr crtc)
+{
+	bool ok = false;
+	if (!wedged(sna))
+		ok = sna->render.fill_one(sna, front, bo, 0,
+					  0, 0, crtc->mode.HDisplay, crtc->mode.VDisplay,
+					  GXclear);
+	if (!ok) {
+		void *ptr = kgem_bo_map__gtt(&sna->kgem, bo);
+		if (ptr)
+			memset(ptr, 0, bo->pitch * crtc->mode.HDisplay);
+	}
+}
+
 static struct kgem_bo *sna_crtc_attach(xf86CrtcPtr crtc)
 {
 	struct sna_crtc *sna_crtc = to_sna_crtc(crtc);
@@ -2083,18 +2099,9 @@ force_shadow:
 			if (b.y2 > scrn->virtualY)
 				b.y2 = scrn->virtualY;
 			if (b.x2 - b.x1 < crtc->mode.HDisplay ||
-			    b.y2 - b.y1 < crtc->mode.VDisplay) {
-				bool ok = false;
-				if (!wedged(sna))
-					ok = sna->render.fill_one(sna, front, bo, 0,
-								  0, 0, crtc->mode.HDisplay, crtc->mode.VDisplay,
-								  GXclear);
-				if (!ok) {
-					void *ptr = kgem_bo_map__gtt(&sna->kgem, bo);
-					if (ptr)
-						memset(ptr, 0, bo->pitch * crtc->mode.VDisplay);
-				}
-			}
+			    b.y2 - b.y1 < crtc->mode.VDisplay)
+				clear(sna, front, bo, crtc);
+
 			if (b.y2 > b.y1 && b.x2 > b.x1) {
 				DrawableRec tmp;
 
@@ -2110,12 +2117,14 @@ force_shadow:
 				tmp.depth = front->drawable.depth;
 				tmp.bitsPerPixel = front->drawable.bitsPerPixel;
 
-				(void)sna->render.copy_boxes(sna, GXcopy,
+				if (!sna->render.copy_boxes(sna, GXcopy,
 							     &front->drawable, __sna_pixmap_get_bo(front), 0, 0,
 							     &tmp, bo, -crtc->x, -crtc->y,
-							     &b, 1, 0);
+							     &b, 1, 0))
+					clear(sna, front, bo, crtc);
 			}
-		}
+		} else
+			clear(sna, front, bo, crtc);
 
 		sna_crtc->shadow_bo_width = crtc->mode.HDisplay;
 		sna_crtc->shadow_bo_height = crtc->mode.VDisplay;


More information about the xorg-commit mailing list