[PATCH 2/2] tests/intel/xe_exec_system_allocator: Rebind the prefetch ranges
sai.gowtham.ch at intel.com
sai.gowtham.ch at intel.com
Thu May 29 11:52:37 UTC 2025
From: Sai Gowtham Ch <sai.gowtham.ch at intel.com>
Test rebinds the prefetch ranges to check the ideal behaviour of prefetch mechanism,
expecting address ranges in the corresponding mem regions has to be created again and
use those address ranges to submit workloads.
v2: Enhance VRAM/SMEM/BIND flags in the selection loop of this test. (Jonathan Cavitt)
v3: integrate prefetch rebind tests in test_exec. (Matthew Brost)
Cc: Himal Prasad Ghimiray <himal.prasad.ghimiray at intel.com>
Cc: Matthew Brost <matthew.brost at intel.com>
Cc: Jonathan Cavitt <jonathan.cavitt at intel.com>
Signed-off-by: Sai Gowtham Ch <sai.gowtham.ch at intel.com>
---
tests/intel/xe_exec_system_allocator.c | 20 ++++++++++++++++++++
1 file changed, 20 insertions(+)
diff --git a/tests/intel/xe_exec_system_allocator.c b/tests/intel/xe_exec_system_allocator.c
index 9596f7be3..fb4db77c3 100644
--- a/tests/intel/xe_exec_system_allocator.c
+++ b/tests/intel/xe_exec_system_allocator.c
@@ -773,6 +773,7 @@ partial(int fd, struct drm_xe_engine_class_instance *eci, unsigned int flags)
#define MULTI_FAULT (0x1 << 21)
#define PREFETCH (0x1 << 22)
#define VRAM (0x1 << 23)
+#define BIND (0x1 << 24)
#define N_MULTI_FAULT 4
#define MAX_BATCH_DWORDS 16
@@ -978,6 +979,12 @@ partial(int fd, struct drm_xe_engine_class_instance *eci, unsigned int flags)
* @vram-SZ_4K: with size of SZ_4K on vram region
* @vram-SZ_64K: with size of SZ_64K on vram region
* @vram-SZ_2M: with size of SZ_2M on vram region
+ * @bind-smem-SZ_4K: with size of SZ_4K on vram and rebinding of smem region
+ * @bind-smem-SZ_64K: with size of SZ_64K on vram and rebinding of smem region
+ * @bind-smem-SZ_2M: with size of SZ_2M on vram and rebinding of smem region
+ * @bind-vram-SZ_4K: with size of SZ_4K on smem and rebinding of vram region
+ * @bind-vram-SZ_64K: with size of SZ_64K on smem and rebinding of vram region
+ * @bind-vram-SZ_2M: with size of SZ_2M on smem and rebinding of vram region
*/
struct test_exec_data {
uint32_t batch[32];
@@ -1392,6 +1399,13 @@ test_exec(int fd, struct drm_xe_engine_class_instance *eci,
sync[0].addr = to_user_pointer(exec_ufence);
xe_vm_prefetch_async(fd, vm, 0, 0, addr, bo_size, sync, 1, flags & VRAM ? 1 : 0);
xe_wait_ufence(fd, exec_ufence, USER_FENCE_VALUE, 0, NSEC_PER_SEC);
+ if (flags & BIND) {
+ exec_ufence[0] = 0;
+ sync[0].addr = to_user_pointer(exec_ufence);
+ xe_vm_prefetch_async(fd, vm, 0, 0, addr, bo_size, sync, 1, flags & VRAM ? 0 : 1);
+ xe_wait_ufence(fd, exec_ufence, USER_FENCE_VALUE, 0, NSEC_PER_SEC);
+ exec_ufence[0] = 0;
+ }
for (i =0; i < n_execs; i++) {
int e = i % n_exec_queues;
@@ -1667,6 +1681,12 @@ igt_main
{ "vram-SZ_4K", PREFETCH, SZ_4K},
{ "vram-SZ_64K", PREFETCH | VRAM, SZ_64K},
{ "vram-SZ_2M", PREFETCH | VRAM, SZ_2M},
+ { "bind-smem-SZ_4K", VRAM | BIND, SZ_4K},
+ { "bind-smem-SZ_64K", VRAM | BIND, SZ_64K},
+ { "bind-smem-SZ_2M", VRAM | BIND, SZ_2M},
+ { "bind-vram-SZ_4K", BIND, SZ_4K},
+ { "bind-vram-SZ_64K", BIND, SZ_64K},
+ { "bind-vram-SZ_2M", BIND, SZ_2M},
{ NULL },
}, *m;
const struct section sections[] = {
--
2.34.1
More information about the igt-dev
mailing list