All of lore.kernel.org
 help / color / mirror / Atom feed
From: ville.syrjala@linux.intel.com
To: intel-gfx@lists.freedesktop.org
Subject: [PATCH i-g-t 2/7] tests/gem_mmap_gtt: Deal with tile sizes on gen2/3
Date: Mon, 14 Dec 2015 22:15:51 +0200	[thread overview]
Message-ID: <1450124156-12679-2-git-send-email-ville.syrjala@linux.intel.com> (raw)
In-Reply-To: <1450124156-12679-1-git-send-email-ville.syrjala@linux.intel.com>

From: Ville Syrjälä <ville.syrjala@linux.intel.com>

Gen2/3 platforms have some unusual tile dimensions. Account
for them to make the test work correctly.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
---
 tests/gem_mmap_gtt.c | 20 +++++++++++++++++---
 1 file changed, 17 insertions(+), 3 deletions(-)

diff --git a/tests/gem_mmap_gtt.c b/tests/gem_mmap_gtt.c
index 4d146426535b..b9c413b6160b 100644
--- a/tests/gem_mmap_gtt.c
+++ b/tests/gem_mmap_gtt.c
@@ -253,6 +253,18 @@ test_write_gtt(int fd)
 	munmap(src, OBJECT_SIZE);
 }
 
+static int tile_width(uint32_t devid, int tiling)
+{
+	if (intel_gen(devid) == 2)
+		return 128;
+	else if (tiling == I915_TILING_X)
+		return 512;
+	else if (IS_915(devid))
+		return 512;
+	else
+		return 128;
+}
+
 static void
 test_huge_bo(int fd, int huge, int tiling)
 {
@@ -261,7 +273,8 @@ test_huge_bo(int fd, int huge, int tiling)
 	char *tiled_pattern;
 	char *linear_pattern;
 	uint64_t size, last_offset;
-	int pitch = tiling == I915_TILING_Y ? 128 : 512;
+	uint32_t devid = intel_get_drm_devid(fd);
+	int pitch = tile_width(devid, tiling);
 	int i;
 
 	switch (huge) {
@@ -327,6 +340,7 @@ test_huge_bo(int fd, int huge, int tiling)
 static void
 test_huge_copy(int fd, int huge, int tiling_a, int tiling_b)
 {
+	uint32_t devid = intel_get_drm_devid(fd);
 	uint64_t huge_object_size, i;
 	uint32_t bo, *pattern_a, *pattern_b;
 	char *a, *b;
@@ -357,7 +371,7 @@ test_huge_copy(int fd, int huge, int tiling_a, int tiling_b)
 
 	bo = gem_create(fd, huge_object_size);
 	if (tiling_a)
-		igt_require(__gem_set_tiling(fd, bo, tiling_a, tiling_a == I915_TILING_Y ? 128 : 512) == 0);
+		igt_require(__gem_set_tiling(fd, bo, tiling_a, tile_width(devid, tiling_a)) == 0);
 	a = __gem_mmap__gtt(fd, bo, huge_object_size, PROT_READ | PROT_WRITE);
 	igt_require(a);
 	gem_close(fd, bo);
@@ -367,7 +381,7 @@ test_huge_copy(int fd, int huge, int tiling_a, int tiling_b)
 
 	bo = gem_create(fd, huge_object_size);
 	if (tiling_b)
-		igt_require(__gem_set_tiling(fd, bo, tiling_b, tiling_b == I915_TILING_Y ? 128 : 512) == 0);
+		igt_require(__gem_set_tiling(fd, bo, tiling_b, tile_width(devid, tiling_b)) == 0);
 	b = __gem_mmap__gtt(fd, bo, huge_object_size, PROT_READ | PROT_WRITE);
 	igt_require(b);
 	gem_close(fd, bo);
-- 
2.4.10

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

  reply	other threads:[~2015-12-14 20:16 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-14 20:15 [PATCH i-g-t 1/7] Fix a bunch of printf types ville.syrjala
2015-12-14 20:15 ` ville.syrjala [this message]
2015-12-14 21:52   ` [PATCH i-g-t 2/7] tests/gem_mmap_gtt: Deal with tile sizes on gen2/3 Chris Wilson
2015-12-15 20:37     ` Ville Syrjälä
2015-12-15 20:51   ` Paulo Zanoni
2015-12-15 21:08     ` Ville Syrjälä
2015-12-15 21:19       ` Paulo Zanoni
2015-12-15 21:30         ` Ville Syrjälä
2015-12-14 20:15 ` [PATCH i-g-t 3/7] tests/gem_mmap_gtt: Add progress indicators ville.syrjala
2015-12-14 20:15 ` [PATCH i-g-t 4/7] tests/gem_mmap_gtt: Make the small-bo tiling tests work on old platforms ville.syrjala
2015-12-14 20:49   ` Chris Wilson
2015-12-14 20:54     ` Chris Wilson
2015-12-15  9:41       ` Ville Syrjälä
2015-12-15  9:57         ` Chris Wilson
2015-12-15 10:57           ` Ville Syrjälä
2015-12-15 11:16             ` Chris Wilson
2015-12-15 11:29               ` Ville Syrjälä
2015-12-15 12:01                 ` Ville Syrjälä
2015-12-15 12:30                   ` Chris Wilson
2015-12-16 10:46                     ` Daniel Vetter
2015-12-16 11:11                       ` Chris Wilson
2015-12-14 20:15 ` [PATCH i-g-t 5/7] lib/debugfs: Read the crc frame counter as hex ville.syrjala
2015-12-15 12:03   ` Morton, Derek J
2015-12-15 12:46     ` Ville Syrjälä
2015-12-14 20:15 ` [PATCH i-g-t 6/7] tests/kms_flip: Increase TEST_TS_CONT max seq difference to 150 ville.syrjala
2015-12-16 10:49   ` Daniel Vetter
2015-12-14 20:15 ` [PATCH i-g-t 7/7] tests/kms_pipe_crc_basic: Use igt_assert_eq() to see the failing frame counts ville.syrjala

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=1450124156-12679-2-git-send-email-ville.syrjala@linux.intel.com \
    --to=ville.syrjala@linux.intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.