public inbox for igt-dev@lists.freedesktop.org
 help / color / mirror / Atom feed
From: Tvrtko Ursulin <tursulin@ursulin.net>
To: igt-dev@lists.freedesktop.org
Cc: Intel-gfx@lists.freedesktop.org,
	Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Subject: [igt-dev] [PATCH i-g-t] tests/gem_set_tiling_vs_pwrite: Skip on unknown swizzling
Date: Thu, 11 Oct 2018 13:30:27 +0100	[thread overview]
Message-ID: <20181011123027.12203-1-tvrtko.ursulin@linux.intel.com> (raw)

From: Tvrtko Ursulin <tvrtko.ursulin@intel.com>

Same as in commit 78071c2fa53d ("igt/gem_tiled_partial_pwrite_pread: Check
for known swizzling"), to be able to compare the bo against the test
pattern we need to skip the test if the swizzling is not compatible.

Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=102575
Cc: Chris Wilson <chris@chris-wilson.co.uk>
---
Eeek confidence level low - is this correct?
---
 tests/gem_set_tiling_vs_pwrite.c | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

diff --git a/tests/gem_set_tiling_vs_pwrite.c b/tests/gem_set_tiling_vs_pwrite.c
index f0126b6484b7..3be908dbd103 100644
--- a/tests/gem_set_tiling_vs_pwrite.c
+++ b/tests/gem_set_tiling_vs_pwrite.c
@@ -42,6 +42,18 @@ IGT_TEST_DESCRIPTION("Check set_tiling vs pwrite coherency.");
 #define OBJECT_SIZE (1024*1024)
 #define TEST_STRIDE (1024*4)
 
+static bool known_swizzling(int fd, 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;
+}
+
 /**
  * Testcase: Check set_tiling vs pwrite coherency
  */
@@ -66,6 +78,12 @@ igt_simple_main
 
 	gem_set_tiling(fd, handle, I915_TILING_X, TEST_STRIDE);
 
+	/*
+	 * As we want to compare our template pattern against
+	 * the target bo, we need consistent swizzling on both.
+	 */
+	igt_require(known_swizzling(fd, handle));
+
 	/* touch it */
 	gem_set_domain(fd, handle, I915_GEM_DOMAIN_GTT, I915_GEM_DOMAIN_GTT);
 	*ptr = 0xdeadbeef;
-- 
2.17.1

_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

             reply	other threads:[~2018-10-11 12:30 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-11 12:30 Tvrtko Ursulin [this message]
2018-10-11 12:34 ` [igt-dev] [PATCH i-g-t] tests/gem_set_tiling_vs_pwrite: Skip on unknown swizzling Chris Wilson
2018-10-11 12:42   ` Tvrtko Ursulin
2018-10-11 12:49     ` Chris Wilson
2018-10-11 13:09       ` Tvrtko Ursulin
2018-10-11 13:50 ` [igt-dev] ✓ Fi.CI.BAT: success for " Patchwork
2018-10-11 21:20 ` [igt-dev] ✗ Fi.CI.IGT: failure " Patchwork

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20181011123027.12203-1-tvrtko.ursulin@linux.intel.com \
    --to=tursulin@ursulin.net \
    --cc=Intel-gfx@lists.freedesktop.org \
    --cc=igt-dev@lists.freedesktop.org \
    --cc=tvrtko.ursulin@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox