diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2016-10-19 14:07:25 +0100 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2016-10-19 16:15:07 +0100 |
commit | e27626898b87a1602e6af6f7effcacf772ead491 (patch) | |
tree | 506e8b40ded5291e4f8a8207038a778dd14572fb /lib/igt_draw.c | |
parent | 27d30707410c4a89480effa75bb6792331ca3342 (diff) |
igt: Check the physical swizzle status
The kernel tries to hide L-shaped memory with asymmetric swizzling from
userspace by reporting lies through the get-tiling interface. Check for
these lies by comparing the reported swizzle with the actual swizzle,
and only run swizzling tests where we know the underlying physical
swizzling.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'lib/igt_draw.c')
-rw-r--r-- | lib/igt_draw.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/igt_draw.c b/lib/igt_draw.c index 45fa10f6..3afb8272 100644 --- a/lib/igt_draw.c +++ b/lib/igt_draw.c @@ -246,7 +246,7 @@ static void draw_rect_mmap_cpu(int fd, struct buf_data *buf, struct rect *rect, gem_set_domain(fd, buf->handle, I915_GEM_DOMAIN_CPU, I915_GEM_DOMAIN_CPU); - gem_get_tiling(fd, buf->handle, &tiling, &swizzle); + igt_require(gem_get_tiling(fd, buf->handle, &tiling, &swizzle)); /* We didn't implement suport for the older tiling methods yet. */ if (tiling != I915_TILING_NONE) @@ -295,7 +295,7 @@ static void draw_rect_mmap_wc(int fd, struct buf_data *buf, struct rect *rect, gem_set_domain(fd, buf->handle, I915_GEM_DOMAIN_GTT, I915_GEM_DOMAIN_GTT); - gem_get_tiling(fd, buf->handle, &tiling, &swizzle); + igt_require(gem_get_tiling(fd, buf->handle, &tiling, &swizzle)); /* We didn't implement suport for the older tiling methods yet. */ if (tiling != I915_TILING_NONE) @@ -392,7 +392,7 @@ static void draw_rect_pwrite(int fd, struct buf_data *buf, { uint32_t tiling, swizzle; - gem_get_tiling(fd, buf->handle, &tiling, &swizzle); + igt_require(gem_get_tiling(fd, buf->handle, &tiling, &swizzle)); switch (tiling) { case I915_TILING_NONE: @@ -419,7 +419,7 @@ static void draw_rect_blt(int fd, struct cmd_data *cmd_data, uint32_t tiling, swizzle; int pitch; - gem_get_tiling(fd, buf->handle, &tiling, &swizzle); + igt_require(gem_get_tiling(fd, buf->handle, &tiling, &swizzle)); dst = gem_handle_to_libdrm_bo(cmd_data->bufmgr, fd, "", buf->handle); igt_assert(dst); @@ -483,7 +483,7 @@ static void draw_rect_render(int fd, struct cmd_data *cmd_data, rect->w % (32 / buf->bpp) != 0 || rect->h % (32 / buf->bpp) != 0); - gem_get_tiling(fd, buf->handle, &tiling, &swizzle); + igt_require(gem_get_tiling(fd, buf->handle, &tiling, &swizzle)); /* We create a temporary buffer and copy from it using rendercopy. */ tmp.size = rect->w * rect->h * pixel_size; |