Igt-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [igt-dev] [PATCH i-g-t] tests/intel/xe_pat: add sanity check for NULL mappings
@ 2023-12-01 15:14 Matthew Auld
  2023-12-01 17:18 ` Souza, Jose
                   ` (4 more replies)
  0 siblings, 5 replies; 7+ messages in thread
From: Matthew Auld @ 2023-12-01 15:14 UTC (permalink / raw)
  To: igt-dev

Any platform supported pat_index should be compatible with NULL bindings
from KMD pov. Make sure that holds true.

Signed-off-by: Matthew Auld <matthew.auld@intel.com>
Cc: Paulo Zanoni <paulo.r.zanoni@intel.com>
Cc: José Roberto de Souza <jose.souza@intel.com>
---
 tests/intel/xe_pat.c | 24 ++++++++++++++++++++++++
 1 file changed, 24 insertions(+)

diff --git a/tests/intel/xe_pat.c b/tests/intel/xe_pat.c
index 78bd96d11..5c61a5169 100644
--- a/tests/intel/xe_pat.c
+++ b/tests/intel/xe_pat.c
@@ -113,12 +113,30 @@ static void pat_index_all(int fd)
 						   size, DRM_XE_VM_BIND_OP_MAP, 0, NULL, 0, 0,
 						   pat_index, 0),
 				      -EINVAL);
+
+			igt_assert_eq(__xe_vm_bind(fd, vm, 0, 0, 0, 0x40000,
+						   size, DRM_XE_VM_BIND_OP_MAP,
+						   DRM_XE_VM_BIND_FLAG_NULL, NULL, 0, 0,
+						   pat_index, 0),
+				      -EINVAL);
 		} else {
 			igt_assert_eq(__xe_vm_bind(fd, vm, 0, bo, 0, 0x40000,
 						   size, DRM_XE_VM_BIND_OP_MAP, 0, NULL, 0, 0,
 						   pat_index, 0),
 				      0);
 			xe_vm_unbind_sync(fd, vm, 0, 0x40000, size);
+
+			/*
+			 * There is no real memory being mapped here, so any
+			 * platform supported pat_index should be acceptable for
+			 * NULL mappings.
+			 */
+			igt_assert_eq(__xe_vm_bind(fd, vm, 0, 0, 0, 0x40000,
+						   size, DRM_XE_VM_BIND_OP_MAP,
+						   DRM_XE_VM_BIND_FLAG_NULL, NULL, 0, 0,
+						   pat_index, 0),
+				      0);
+			xe_vm_unbind_sync(fd, vm, 0, 0x40000, size);
 		}
 	}
 
@@ -127,6 +145,12 @@ static void pat_index_all(int fd)
 				   pat_index, 0),
 		      -EINVAL);
 
+	igt_assert_eq(__xe_vm_bind(fd, vm, 0, 0, 0, 0x40000,
+				   size, DRM_XE_VM_BIND_OP_MAP,
+				   DRM_XE_VM_BIND_FLAG_NULL, NULL, 0, 0,
+				   pat_index, 0),
+		      -EINVAL);
+
 	gem_close(fd, bo);
 
 	/* coh_none is never allowed with cpu_caching WB. */
-- 
2.43.0

^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2023-12-05 13:09 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-12-01 15:14 [igt-dev] [PATCH i-g-t] tests/intel/xe_pat: add sanity check for NULL mappings Matthew Auld
2023-12-01 17:18 ` Souza, Jose
2023-12-01 18:08 ` [igt-dev] ✓ Fi.CI.BAT: success for " Patchwork
2023-12-01 19:32 ` [igt-dev] ✓ CI.xeBAT: " Patchwork
2023-12-03  2:28 ` [igt-dev] ✗ Fi.CI.IGT: failure " Patchwork
2023-12-04 10:10   ` Kamil Konieczny
2023-12-05 13:09 ` [igt-dev] ✓ Fi.CI.IGT: success " Patchwork

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox