xf86-video-intel: 2 commits - src/sna/kgem.c src/sna/sna_dri2.c test/dri2-race.c

Chris Wilson ickle at kemper.freedesktop.org
Sat Feb 13 08:49:32 UTC 2016


 src/sna/kgem.c     |    1 +
 src/sna/sna_dri2.c |    1 +
 test/dri2-race.c   |   38 +++++++++++++++++++-------------------
 3 files changed, 21 insertions(+), 19 deletions(-)

New commits:
commit b2cd809fe2b06325a4572865ec7ca5cfbfcfced2
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Sat Feb 13 08:47:29 2016 +0000

    test/dri2-race: Tweak runtimes
    
    When we specify a divider we are looking for slightly different races
    that are in theory not so timing dependent (since we are using vrefresh
    windows). However, since they each take some multiple of vblanks to
    complete, they are much slower. We should be able to reduce the number
    of iterations without losing detection capability.
    
    Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>

diff --git a/test/dri2-race.c b/test/dri2-race.c
index a79ddaf..d75293b 100644
--- a/test/dri2-race.c
+++ b/test/dri2-race.c
@@ -118,8 +118,8 @@ static void race_window(Display *dpy, int width, int height,
 	 */
 	attr.override_redirect = 1;
 	for (n = 0; n < N_DIVISORS; n++) {
-		printf("DRI2SwapBuffers(divisor=%d)", divisors[n]);
-		loop = 100;
+		loop = 256 >> ffs(divisors[n]);
+		printf("DRI2SwapBuffers(divisor=%d), loop=%d", divisors[n], loop);
 		do {
 			win = XCreateWindow(dpy, DefaultRootWindow(dpy),
 					0, 0, width, height, 0,
@@ -146,8 +146,8 @@ static void race_window(Display *dpy, int width, int height,
 	}
 
 	for (n = 0; n < N_DIVISORS; n++) {
-		printf("xcb_dri2_swap_buffers(divisor=%d)", divisors[n]);
-		loop = 100;
+		loop = 256 >> ffs(divisors[n]);
+		printf("xcb_dri2_swap_buffers(divisor=%d), loops=%d", divisors[n], loop);
 		do {
 			win = XCreateWindow(dpy, DefaultRootWindow(dpy),
 					0, 0, width, height, 0,
@@ -174,8 +174,8 @@ static void race_window(Display *dpy, int width, int height,
 	}
 
 	for (n = 0; n < N_DIVISORS; n++) {
-		printf("DRI2WaitMsc(divisor=%d)", divisors[n]);
-		loop = 100;
+		loop = 256 >> ffs(divisors[n]);
+		printf("DRI2WaitMsc(divisor=%d), loop=%d", divisors[n], loop);
 		do {
 			uint64_t ignore, msc;
 			xcb_connection_t *c = XGetXCBConnection(dpy);
@@ -196,7 +196,7 @@ static void race_window(Display *dpy, int width, int height,
 						xcb_dri2_wait_msc(c, win,
 							upper_32_bits(msc),
 							lower_32_bits(msc),
-							0, 1, 0, 0).sequence);
+							0, 0, 0, 0).sequence);
 				msc += divisors[n];
 			}
 			XFlush(dpy);
@@ -229,7 +229,7 @@ static void race_manager(Display *dpy, int width, int height,
 	attr.override_redirect = 1;
 	for (n = 0; n < N_DIVISORS; n++) {
 		printf("DRI2SwapBuffers(divisor=%d)", divisors[n]);
-		loop = 100;
+		loop = 256 >> ffs(divisors[n]);
 		do {
 			win = XCreateWindow(dpy, DefaultRootWindow(dpy),
 					0, 0, width, height, 0,
@@ -259,7 +259,7 @@ static void race_manager(Display *dpy, int width, int height,
 
 	for (n = 0; n < N_DIVISORS; n++) {
 		printf("xcb_dri2_swap_buffers(divisor=%d)", divisors[n]);
-		loop = 100;
+		loop = 256 >> ffs(divisors[n]);
 		do {
 			win = XCreateWindow(dpy, DefaultRootWindow(dpy),
 					0, 0, width, height, 0,
@@ -289,7 +289,7 @@ static void race_manager(Display *dpy, int width, int height,
 
 	for (n = 0; n < N_DIVISORS; n++) {
 		printf("DRI2WaitMsc(divisor=%d)", divisors[n]);
-		loop = 100;
+		loop = 256 >> ffs(divisors[n]);
 		do {
 			uint64_t ignore, msc;
 			xcb_connection_t *c = XGetXCBConnection(dpy);
@@ -310,7 +310,7 @@ static void race_manager(Display *dpy, int width, int height,
 						xcb_dri2_wait_msc(c, win,
 							upper_32_bits(msc),
 							lower_32_bits(msc),
-							0, 1, 0, 0).sequence);
+							0, 0, 0, 0).sequence);
 				msc += divisors[n];
 			}
 			XFlush(dpy);
@@ -345,7 +345,7 @@ static void race_close(int width, int height,
 	attr.override_redirect = 1;
 	for (n = 0; n < N_DIVISORS; n++) {
 		printf("DRI2SwapBuffers(divisor=%d)", divisors[n]);
-		loop = 100;
+		loop = 256 >> ffs(divisors[n]);
 		do {
 			Display *dpy = XOpenDisplay(NULL);
 			Window win = XCreateWindow(dpy, DefaultRootWindow(dpy),
@@ -373,7 +373,7 @@ static void race_close(int width, int height,
 
 	for (n = 0; n < N_DIVISORS; n++) {
 		printf("xcb_dri2_swap_buffers(divisor=%d)", divisors[n]);
-		loop = 100;
+		loop = 256 >> ffs(divisors[n]);
 		do {
 			Display *dpy = XOpenDisplay(NULL);
 			Window win = XCreateWindow(dpy, DefaultRootWindow(dpy),
@@ -401,7 +401,7 @@ static void race_close(int width, int height,
 
 	for (n = 0; n < N_DIVISORS; n++) {
 		printf("DRI2WaitMsc(divisor=%d)", divisors[n]);
-		loop = 100;
+		loop = 256 >> ffs(divisors[n]);
 		do {
 			uint64_t ignore, msc;
 			Display *dpy = XOpenDisplay(NULL);
@@ -423,7 +423,7 @@ static void race_close(int width, int height,
 						xcb_dri2_wait_msc(c, win,
 							upper_32_bits(msc),
 							lower_32_bits(msc),
-							0, 1, 0, 0).sequence);
+							0, 0, 0, 0).sequence);
 				msc += divisors[n];
 			}
 			XFlush(dpy);
@@ -450,7 +450,7 @@ static void race_client(int width, int height,
 	attr.override_redirect = 1;
 	for (n = 0; n < N_DIVISORS; n++) {
 		printf("DRI2SwapBuffers(divisor=%d)", divisors[n]);
-		loop = 100;
+		loop = 256 >> ffs(divisors[n]);
 		do {
 			Display *dpy;
 			Window win;
@@ -492,7 +492,7 @@ static void race_client(int width, int height,
 
 	for (n = 0; n < N_DIVISORS; n++) {
 		printf("xcb_dri2_swap_buffers(divisor=%d)", divisors[n]);
-		loop = 100;
+		loop = 256 >> ffs(divisors[n]);
 		do {
 			Display *dpy;
 			Window win;
@@ -534,7 +534,7 @@ static void race_client(int width, int height,
 
 	for (n = 0; n < N_DIVISORS; n++) {
 		printf("DRI2WaitMsc(divisor=%d)", divisors[n]);
-		loop = 100;
+		loop = 256 >> ffs(divisors[n]);
 		do {
 			uint64_t ignore, msc;
 			Display *dpy;
@@ -564,7 +564,7 @@ static void race_client(int width, int height,
 						  xcb_dri2_wait_msc(c, win,
 								    upper_32_bits(msc),
 								    lower_32_bits(msc),
-								    0, 1, 0, 0).sequence);
+								    0, 0, 0, 0).sequence);
 				msc += divisors[n];
 			}
 
commit 8f04d6721fe0ac844fa66df3167a779bac236138
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Sat Feb 13 08:46:58 2016 +0000

    sna/dri2: Initialize priv->cache_size
    
    Silence a valgrind warning, though it should have no runtime impace.
    
    Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>

diff --git a/src/sna/kgem.c b/src/sna/kgem.c
index 3656d5f..f441396 100644
--- a/src/sna/kgem.c
+++ b/src/sna/kgem.c
@@ -2910,6 +2910,7 @@ static void __kgem_bo_destroy(struct kgem *kgem, struct kgem_bo *bo)
 	DBG(("%s: handle=%d, size=%d\n", __FUNCTION__, bo->handle, bytes(bo)));
 
 	assert(list_is_empty(&bo->list));
+	assert(list_is_empty(&bo->vma));
 	assert(bo->refcnt == 0);
 	assert(bo->proxy == NULL);
 	assert(bo->active_scanout == 0);
diff --git a/src/sna/sna_dri2.c b/src/sna/sna_dri2.c
index 045b12d..fcfbd9d 100644
--- a/src/sna/sna_dri2.c
+++ b/src/sna/sna_dri2.c
@@ -1519,6 +1519,7 @@ draw_current_msc(DrawablePtr draw, xf86CrtcPtr crtc, uint64_t msc)
 			priv->msc_delta = 0;
 			priv->chain = NULL;
 			priv->scanout = -1;
+			priv->cache_size = 0;
 			list_init(&priv->cache);
 			dri2_window_attach((WindowPtr)draw, priv);
 		}


More information about the xorg-commit mailing list