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

Chris Wilson ickle at kemper.freedesktop.org
Tue Apr 21 07:08:43 PDT 2015


 src/sna/sna_accel.c |    9 +++++----
 test/present-test.c |   28 ++++++++++++++++++++++++++--
 2 files changed, 31 insertions(+), 6 deletions(-)

New commits:
commit 33374755c5462849cb0bb1d549328cd9b00ba1d5
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Tue Apr 21 15:02:13 2015 +0100

    sna: Add a define to change scanout tilings by default
    
    Just for testing, you hear?
    
    Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>

diff --git a/src/sna/sna_accel.c b/src/sna/sna_accel.c
index ce09665..8e63b14 100644
--- a/src/sna/sna_accel.c
+++ b/src/sna/sna_accel.c
@@ -67,7 +67,8 @@
 #define FORCE_FLUSH 0
 #define FORCE_FULL_SYNC 0 /* https://bugs.freedesktop.org/show_bug.cgi?id=61628 */
 
-#define DEFAULT_TILING I915_TILING_X
+#define DEFAULT_PIXMAP_TILING I915_TILING_X
+#define DEFAULT_SCANOUT_TILING I915_TILING_X
 
 #define USE_INPLACE 1
 #define USE_SPANS 0 /* -1 force CPU, 1 force GPU */
@@ -613,9 +614,9 @@ static bool sna_pixmap_free_cpu(struct sna *sna, struct sna_pixmap *priv, bool a
 
 static inline uint32_t default_tiling(struct sna *sna, PixmapPtr pixmap)
 {
-#if DEFAULT_TILING == I915_TILING_NONE
+#if DEFAULT_PIXMAP_TILING == I915_TILING_NONE
 	return I915_TILING_NONE;
-#elif DEFAULT_TILING == I915_TILING_X
+#elif DEFAULT_PIXMAP_TILING == I915_TILING_X
 	return I915_TILING_X;
 #else
 	/* Try to avoid hitting the Y-tiling GTT mapping bug on 855GM */
@@ -1648,7 +1649,7 @@ static bool sna_pixmap_alloc_gpu(struct sna *sna,
 	if (pixmap->usage_hint == SNA_CREATE_FB && (sna->flags & SNA_LINEAR_FB) == 0) {
 		flags |= CREATE_SCANOUT;
 		tiling = kgem_choose_tiling(&sna->kgem,
-					    -I915_TILING_X,
+					    -DEFAULT_SCANOUT_TILING,
 					    pixmap->drawable.width,
 					    pixmap->drawable.height,
 					    pixmap->drawable.bitsPerPixel);
commit 65cc48757e00c81834d39fe90638255723eeb3c6
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Tue Apr 21 15:06:18 2015 +0100

    test/present: Do a double flip to test tiling changes
    
    Since the first flip may require a fixup, we will only really know with
    the second flip whether we can start a flip chain with different tiling.
    
    Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>

diff --git a/test/present-test.c b/test/present-test.c
index 3630241..b33fd2e 100644
--- a/test/present-test.c
+++ b/test/present-test.c
@@ -1564,6 +1564,7 @@ static int test_dri3_tiling(Display *dpy)
 	unsigned int width, height;
 	unsigned border, depth, bpp;
 	unsigned stride, size;
+	void *Q;
 	int x, y;
 	int device;
 	int line = -1;
@@ -1594,8 +1595,10 @@ static int test_dri3_tiling(Display *dpy)
 	       width, height, stride, size);
 
 	_x_error_occurred = 0;
+	Q = setup_msc(dpy, root);
 
 	for (t = 0; t < sizeof(tiling)/sizeof(tiling[0]); t++) {
+		uint64_t msc;
 		uint32_t src;
 		int src_fd;
 		Pixmap src_pix;
@@ -1618,6 +1621,8 @@ static int test_dri3_tiling(Display *dpy)
 					     width, height, depth,
 					     src_fd, bpp, stride, size);
 
+		msc = wait_vblank(dpy, root, Q);
+
 		xcb_present_pixmap(XGetXCBConnection(dpy),
 				   win, src_pix,
 				   0, /* sbc */
@@ -1629,10 +1634,27 @@ static int test_dri3_tiling(Display *dpy)
 				   None, /* wait fence */
 				   None,
 				   XCB_PRESENT_OPTION_NONE,
-				   0, /* target msc */
-				   0, /* divisor */
+				   msc + 2, /* target msc */
+				   1, /* divisor */
+				   0, /* remainder */
+				   0, NULL);
+
+		xcb_present_pixmap(XGetXCBConnection(dpy),
+				   win, src_pix,
+				   0, /* sbc */
+				   0, /* valid */
+				   0, /* update */
+				   0, /* x_off */
+				   0, /* y_off */
+				   None,
+				   None, /* wait fence */
+				   None,
+				   XCB_PRESENT_OPTION_NONE,
+				   msc + 3, /* target msc */
+				   1, /* divisor */
 				   0, /* remainder */
 				   0, NULL);
+
 		XSync(dpy, True);
 		if (_x_error_occurred) {
 			line = __LINE__;
@@ -1645,10 +1667,12 @@ static int test_dri3_tiling(Display *dpy)
 		gem_close(device, src);
 	}
 
+	teardown_msc(dpy, Q);
 	return 0;
 
 fail:
 	printf("%s failed with tiling %d, line %d\n", __func__, tiling[t], line);
+	teardown_msc(dpy, Q);
 	return 1;
 }
 


More information about the xorg-commit mailing list