summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2015-11-12 09:29:07 +0000
committerChris Wilson <chris@chris-wilson.co.uk>2015-11-12 09:30:39 +0000
commit143a2160583a3223ebfc1fd1376a23cec1b81484 (patch)
tree7054dc326082b140531ceb4e39ed5d87d66d9beb /tests
parent0c26652911986e2b1f666f662459a9e240428dc6 (diff)
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 <chris@chris-wilson.co.uk>
Diffstat (limited to 'tests')
-rw-r--r--tests/gem_mmap_gtt.c10
1 files 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);