summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2018-06-15 13:44:33 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2018-07-06 11:29:49 +0100
commit78071c2fa53db2f04b8eddc6e6118be4fbc5c2fe (patch)
tree17db47382eddf04c6719dcf13c2ba8e7ab39a386 /tests
parent8b3cc74c6911e9b2835fe6e160f84bae463a70ef (diff)
igt/gem_tiled_partial_pwrite_pread: Check for known swizzling
As we want to compare a templated tiling pattern against the target_bo, we need to know that the swizzling is compatible. Or else the two tiling pattern may differ due to underlying page address that we cannot know, and so the test may sporadically fail. References: https://bugs.freedesktop.org/show_bug.cgi?id=102575 Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com> Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/gem_tiled_partial_pwrite_pread.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/gem_tiled_partial_pwrite_pread.c b/tests/gem_tiled_partial_pwrite_pread.c
index fe573c37..05d28686 100644
--- a/tests/gem_tiled_partial_pwrite_pread.c
+++ b/tests/gem_tiled_partial_pwrite_pread.c
@@ -249,6 +249,18 @@ static void test_partial_read_writes(void)
}
}
+static bool known_swizzling(uint32_t handle)
+{
+ struct drm_i915_gem_get_tiling arg = {
+ .handle = handle,
+ };
+
+ if (igt_ioctl(fd, DRM_IOCTL_I915_GEM_GET_TILING, &arg))
+ return false;
+
+ return arg.phys_swizzle_mode == arg.swizzle_mode;
+}
+
igt_main
{
uint32_t tiling_mode = I915_TILING_X;
@@ -271,6 +283,12 @@ igt_main
&tiling_mode, &scratch_pitch, 0);
igt_assert(tiling_mode == I915_TILING_X);
igt_assert(scratch_pitch == 4096);
+
+ /*
+ * As we want to compare our template tiled pattern against
+ * the target bo, we need consistent swizzling on both.
+ */
+ igt_require(known_swizzling(scratch_bo->handle));
staging_bo = drm_intel_bo_alloc(bufmgr, "staging bo", BO_SIZE, 4096);
tiled_staging_bo = drm_intel_bo_alloc_tiled(bufmgr, "scratch bo", 1024,
BO_SIZE/4096, 4,