diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2015-04-21 15:06:18 +0100 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2015-04-21 15:06:18 +0100 |
commit | 65cc48757e00c81834d39fe90638255723eeb3c6 (patch) | |
tree | f454fce710943ce6cc35b3ece5b5e0e54e7052a5 /test | |
parent | 37cf561fd2f26a51ef60078e2e31ed02e5380c41 (diff) |
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@chris-wilson.co.uk>
Diffstat (limited to 'test')
-rw-r--r-- | test/present-test.c | 28 |
1 files changed, 26 insertions, 2 deletions
diff --git a/test/present-test.c b/test/present-test.c index 3630241a..b33fd2e0 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; } |