diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2016-08-30 14:35:36 +0100 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2016-08-30 14:36:31 +0100 |
commit | db97b69c5c134be35177c8d1fd502ca90d5f304a (patch) | |
tree | ccbdd7e97679572254f54196bbcd03aa77b9c2f2 /tests/prime_vgem.c | |
parent | 96e1eacc0402e6d03fa6ec9f7b48ff2f53241222 (diff) |
prime_vgem: Fix fence flipping
On the move to doing front/back flips, I managed to completely break the
test by forgetting to pass the fence to be signaled.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'tests/prime_vgem.c')
-rw-r--r-- | tests/prime_vgem.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/tests/prime_vgem.c b/tests/prime_vgem.c index 1a9900ac..8985e019 100644 --- a/tests/prime_vgem.c +++ b/tests/prime_vgem.c @@ -632,11 +632,12 @@ static void flip_to_vgem(int i915, int vgem, struct drm_event_vblank vbl; uint32_t fence; + fence = vgem_fence_attach(vgem, bo, VGEM_FENCE_WRITE | hang); + igt_fork(child, 1) { - fence = vgem_fence_attach(vgem, bo, VGEM_FENCE_WRITE | hang); do_or_die(drmModePageFlip(i915, crtc_id, fb_id, DRM_MODE_PAGE_FLIP_EVENT, &fb_id)); - kill(getppid(), SIGALRM); + kill(getppid(), SIGHUP); /* Check we don't flip before the fence is ready */ pfd.fd = i915; @@ -679,11 +680,12 @@ static void test_flip(int i915, int vgem, unsigned hang) { struct vgem_bo bo[2]; uint32_t fb_id[2], handle[2], crtc_id; - int fd; - signal(SIGALRM, sighandler); + signal(SIGHUP, sighandler); for (int i = 0; i < 2; i++) { + int fd; + bo[i].width = 1024; bo[i].height = 768; bo[i].bpp = 32; @@ -693,6 +695,7 @@ static void test_flip(int i915, int vgem, unsigned hang) handle[i] = prime_fd_to_handle(i915, fd); igt_assert(handle[i]); close(fd); + do_or_die(__kms_addfb(i915, handle[i], bo[i].width, bo[i].height, bo[i].pitch, DRM_FORMAT_XRGB8888, I915_TILING_NONE, @@ -723,7 +726,7 @@ static void test_flip(int i915, int vgem, unsigned hang) gem_close(vgem, bo[i].handle); } - signal(SIGALRM, SIG_DFL); + signal(SIGHUP, SIG_DFL); } igt_main |