[PATCH i-g-t 03/15] tests/xe_spin_batch: change width and pitch to be in valid range

Zbigniew Kempczyński zbigniew.kempczynski at intel.com
Tue May 13 18:57:58 UTC 2025


For mem-copy (byte mode) width and pitch must be lesser or equal 256K.
Limit them, avoiding setting inappropriate bits in mem-copy operation.

Signed-off-by: Zbigniew Kempczyński <zbigniew.kempczynski at intel.com>
Cc: Francois Dugast <francois.dugast at intel.com>
---
 tests/intel/xe_spin_batch.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/tests/intel/xe_spin_batch.c b/tests/intel/xe_spin_batch.c
index f83f4ba722..4fff34a092 100644
--- a/tests/intel/xe_spin_batch.c
+++ b/tests/intel/xe_spin_batch.c
@@ -318,7 +318,7 @@ static void xe_spin_fixed_duration(int fd, int gt, int class, int flags)
 static void xe_spin_mem_copy_region(int fd, struct drm_xe_engine_class_instance *hwe,
 				    uint32_t region)
 {
-	uint32_t copy_size = SZ_4M;
+	uint32_t copy_size = SZ_256K;
 	uint64_t duration_ns = NSEC_PER_SEC / 10;
 	intel_ctx_t *ctx;
 	uint32_t vm, exec_queue;
@@ -349,10 +349,10 @@ static void xe_spin_mem_copy_region(int fd, struct drm_xe_engine_class_instance
 	/* Create source and destination objects used for the copy */
 	src_handle = xe_bo_create(fd, 0, copy_size, region, 0);
 	dst_handle = xe_bo_create(fd, 0, copy_size, region, 0);
-	blt_set_mem_object(mem_copy.src, src_handle, copy_size, 0, width, height, region,
+	blt_set_mem_object(mem_copy.src, src_handle, copy_size, width, width, height, region,
 			   intel_get_uc_mocs_index(fd), DEFAULT_PAT_INDEX,
 			   M_LINEAR, COMPRESSION_DISABLED);
-	blt_set_mem_object(mem_copy.dst, dst_handle, copy_size, 0, width, height, region,
+	blt_set_mem_object(mem_copy.dst, dst_handle, copy_size, width, width, height, region,
 			   intel_get_uc_mocs_index(fd), DEFAULT_PAT_INDEX,
 			   M_LINEAR, COMPRESSION_DISABLED);
 	mem_copy.src->ptr = xe_bo_map(fd, src_handle, copy_size);
-- 
2.43.0



More information about the igt-dev mailing list