Igt-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Matthew Auld <matthew.auld@intel.com>
To: igt-dev@lists.freedesktop.org
Cc: Matthew Brost <matthew.brost@intel.com>
Subject: [PATCH i-g-t] tests/intel/xe_mmap: fix assert_caching on small-bar
Date: Fri, 22 Nov 2024 16:47:30 +0000	[thread overview]
Message-ID: <20241122164730.326543-1-matthew.auld@intel.com> (raw)

Make sure we ask for DRM_XE_GEM_CREATE_FLAG_NEEDS_VISIBLE_VRAM to avoid
sigbus here.

Signed-off-by: Matthew Auld <matthew.auld@intel.com>
Cc: Matthew Brost <matthew.brost@intel.com>
---
 tests/intel/xe_mmap.c | 19 ++++++++++++-------
 1 file changed, 12 insertions(+), 7 deletions(-)

diff --git a/tests/intel/xe_mmap.c b/tests/intel/xe_mmap.c
index fc5d73d59..d818cc2f8 100644
--- a/tests/intel/xe_mmap.c
+++ b/tests/intel/xe_mmap.c
@@ -207,7 +207,8 @@ static void test_small_bar(int fd)
 	gem_close(fd, bo);
 }
 
-static void assert_caching(int fd, uint64_t placement, uint16_t cpu_caching, bool fail)
+static void assert_caching(int fd, uint64_t placement, uint32_t flags,
+			   uint16_t cpu_caching, bool fail)
 {
 	uint64_t size = xe_get_default_alignment(fd);
 	uint64_t mmo;
@@ -215,7 +216,7 @@ static void assert_caching(int fd, uint64_t placement, uint16_t cpu_caching, boo
 	uint32_t *map;
 	bool ret;
 
-	ret = __xe_bo_create_caching(fd, 0, size, placement, 0, cpu_caching, &handle);
+	ret = __xe_bo_create_caching(fd, 0, size, placement, flags, cpu_caching, &handle);
 	igt_assert(ret == fail);
 
 	if (fail)
@@ -237,22 +238,26 @@ static void test_cpu_caching(int fd)
 {
 	if (vram_memory(fd, 0)) {
 		assert_caching(fd, vram_memory(fd, 0),
+			       DRM_XE_GEM_CREATE_FLAG_NEEDS_VISIBLE_VRAM,
 			       DRM_XE_GEM_CPU_CACHING_WC, false);
 		assert_caching(fd, vram_memory(fd, 0) | system_memory(fd),
+			       DRM_XE_GEM_CREATE_FLAG_NEEDS_VISIBLE_VRAM,
 			       DRM_XE_GEM_CPU_CACHING_WC, false);
 
 		assert_caching(fd, vram_memory(fd, 0),
+			       DRM_XE_GEM_CREATE_FLAG_NEEDS_VISIBLE_VRAM,
 			       DRM_XE_GEM_CPU_CACHING_WB, true);
 		assert_caching(fd, vram_memory(fd, 0) | system_memory(fd),
+			       DRM_XE_GEM_CREATE_FLAG_NEEDS_VISIBLE_VRAM,
 			       DRM_XE_GEM_CPU_CACHING_WB, true);
 	}
 
-	assert_caching(fd, system_memory(fd), DRM_XE_GEM_CPU_CACHING_WB, false);
-	assert_caching(fd, system_memory(fd), DRM_XE_GEM_CPU_CACHING_WC, false);
+	assert_caching(fd, system_memory(fd), 0, DRM_XE_GEM_CPU_CACHING_WB, false);
+	assert_caching(fd, system_memory(fd), 0, DRM_XE_GEM_CPU_CACHING_WC, false);
 
-	assert_caching(fd, system_memory(fd), -1, true);
-	assert_caching(fd, system_memory(fd), 0, true);
-	assert_caching(fd, system_memory(fd), DRM_XE_GEM_CPU_CACHING_WC + 1, true);
+	assert_caching(fd, system_memory(fd), 0, -1, true);
+	assert_caching(fd, system_memory(fd), 0, 0, true);
+	assert_caching(fd, system_memory(fd), 0, DRM_XE_GEM_CPU_CACHING_WC + 1, true);
 }
 
 igt_main
-- 
2.47.0


             reply	other threads:[~2024-11-22 16:47 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-11-22 16:47 Matthew Auld [this message]
2024-11-22 19:19 ` ✓ i915.CI.BAT: success for tests/intel/xe_mmap: fix assert_caching on small-bar Patchwork
2024-11-22 19:23 ` ✓ Xe.CI.BAT: " Patchwork
2024-11-24  3:19 ` ✗ Xe.CI.Full: failure " Patchwork
2024-12-10 11:24   ` Kamil Konieczny
2024-11-24 20:32 ` ✗ i915.CI.Full: " Patchwork
2024-12-10 11:26   ` Kamil Konieczny
2024-12-09  9:23 ` [PATCH i-g-t] " Grzegorzek, Dominik

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=20241122164730.326543-1-matthew.auld@intel.com \
    --to=matthew.auld@intel.com \
    --cc=igt-dev@lists.freedesktop.org \
    --cc=matthew.brost@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