From 143a2160583a3223ebfc1fd1376a23cec1b81484 Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Thu, 12 Nov 2015 09:29:07 +0000 Subject: [PATCH] igt/gem_mmap_gtt: Require SET_TILING to work before doing large tiled tests Older generations are more limited in how much they can fence, and the limits is enforced in the SET_TILING ioctl. So if it reports an EINVAL, we cannot perform the tiled test and may just skip it instead. Signed-off-by: Chris Wilson --- tests/gem_mmap_gtt.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/tests/gem_mmap_gtt.c b/tests/gem_mmap_gtt.c index f586bf19..4d146426 100644 --- a/tests/gem_mmap_gtt.c +++ b/tests/gem_mmap_gtt.c @@ -282,7 +282,7 @@ test_huge_bo(int fd, int huge, int tiling) /* Create pattern */ bo = gem_create(fd, PAGE_SIZE); if (tiling) - gem_set_tiling(fd, bo, tiling, pitch); + igt_require(__gem_set_tiling(fd, bo, tiling, pitch) == 0); linear_pattern = gem_mmap__gtt(fd, bo, PAGE_SIZE, PROT_READ | PROT_WRITE); for (i = 0; i < PAGE_SIZE; i++) @@ -294,7 +294,7 @@ test_huge_bo(int fd, int huge, int tiling) bo = gem_create(fd, size); if (tiling) - gem_set_tiling(fd, bo, tiling, pitch); + igt_require(__gem_set_tiling(fd, bo, tiling, pitch) == 0); /* Initialise first/last page through CPU mmap */ ptr = gem_mmap__cpu(fd, bo, 0, size, PROT_READ | PROT_WRITE); @@ -357,8 +357,7 @@ test_huge_copy(int fd, int huge, int tiling_a, int tiling_b) bo = gem_create(fd, huge_object_size); if (tiling_a) - gem_set_tiling(fd, bo, tiling_a, - tiling_a == I915_TILING_Y ? 128 : 512); + igt_require(__gem_set_tiling(fd, bo, tiling_a, tiling_a == I915_TILING_Y ? 128 : 512) == 0); a = __gem_mmap__gtt(fd, bo, huge_object_size, PROT_READ | PROT_WRITE); igt_require(a); gem_close(fd, bo); @@ -368,8 +367,7 @@ test_huge_copy(int fd, int huge, int tiling_a, int tiling_b) bo = gem_create(fd, huge_object_size); if (tiling_b) - gem_set_tiling(fd, bo, tiling_b, - tiling_b == I915_TILING_Y ? 128 : 512); + igt_require(__gem_set_tiling(fd, bo, tiling_b, tiling_b == I915_TILING_Y ? 128 : 512) == 0); b = __gem_mmap__gtt(fd, bo, huge_object_size, PROT_READ | PROT_WRITE); igt_require(b); gem_close(fd, bo);