[PATCH i-g-t v3 01/11] lib/intel_cmds_info: rename M to TYPE in blt_memop_type

Zbigniew Kempczyński zbigniew.kempczynski at intel.com
Fri May 23 08:01:16 UTC 2025


Documentation separates type and mode in mem-copy so rename prefix
to avoid ambiguity.

Cc: Francois Dugast <francois.dugast at intel.com>
Reviewed-by: Francois Dugast <francois.dugast at intel.com>
Signed-off-by: Zbigniew Kempczyński <zbigniew.kempczynski at intel.com>
---
 lib/intel_blt.c              |  2 +-
 lib/intel_cmds_info.c        |  8 ++++----
 lib/intel_cmds_info.h        | 10 ++++++++--
 tests/intel/xe_copy_basic.c  |  6 +++---
 tests/intel/xe_render_copy.c |  4 ++--
 tests/intel/xe_spin_batch.c  |  4 ++--
 6 files changed, 20 insertions(+), 14 deletions(-)

diff --git a/lib/intel_blt.c b/lib/intel_blt.c
index 7010d3ff7d..33efbf1038 100644
--- a/lib/intel_blt.c
+++ b/lib/intel_blt.c
@@ -1827,7 +1827,7 @@ static void emit_blt_mem_copy(int fd, uint64_t ahnd, const struct blt_mem_data *
 					  0, mem->dst.pat_index);
 
 	batch = bo_map(fd, mem->bb.handle, mem->bb.size, mem->driver);
-	optype = mem->src.type == M_MATRIX ? 1 << 17 : 0;
+	optype = mem->src.type == TYPE_MATRIX ? 1 << 17 : 0;
 
 	i = 0;
 	batch[i++] = MEM_COPY_CMD | optype;
diff --git a/lib/intel_cmds_info.c b/lib/intel_cmds_info.c
index d581edb6eb..3bd5eab653 100644
--- a/lib/intel_cmds_info.c
+++ b/lib/intel_cmds_info.c
@@ -74,13 +74,13 @@ static const struct blt_cmd_info
 
 static const struct blt_cmd_info
 		pvc_mem_copy = BLT_INFO(MEM_COPY,
-					BIT(M_LINEAR) |
-					BIT(M_MATRIX));
+					BIT(TYPE_LINEAR) |
+					BIT(TYPE_MATRIX));
 
 static const struct blt_cmd_info
 		pvc_mem_set = BLT_INFO(MEM_SET,
-				       BIT(M_LINEAR) |
-				       BIT(M_MATRIX));
+				       BIT(TYPE_LINEAR) |
+				       BIT(TYPE_MATRIX));
 
 static const struct blt_cmd_info
 		pre_gen6_xy_color_blt = BLT_INFO(XY_COLOR_BLT, TILE_L_X);
diff --git a/lib/intel_cmds_info.h b/lib/intel_cmds_info.h
index 7960e0412e..88ba892645 100644
--- a/lib/intel_cmds_info.h
+++ b/lib/intel_cmds_info.h
@@ -19,9 +19,15 @@ enum blt_tiling_type {
 	__BLT_MAX_TILING
 };
 
+/**
+ * enum blt_memop_type - memory operation type for mem-copy and mem-set.
+ *
+ * Mem-copy and mem-set support two types of object copy/fill -
+ * linear (1D buffer) and matrix (2D buffer).
+ */
 enum blt_memop_type {
-	M_LINEAR,
-	M_MATRIX,
+	TYPE_LINEAR,
+	TYPE_MATRIX,
 };
 
 enum blt_cmd_type {
diff --git a/tests/intel/xe_copy_basic.c b/tests/intel/xe_copy_basic.c
index d4300b85c0..a9e9bd2359 100644
--- a/tests/intel/xe_copy_basic.c
+++ b/tests/intel/xe_copy_basic.c
@@ -58,10 +58,10 @@ mem_copy(int fd, uint32_t src_handle, uint32_t dst_handle, const intel_ctx_t *ct
 
 	blt_mem_init(fd, &mem);
 	blt_set_mem_object(&mem.src, src_handle, size, width, width, height,
-			   region, src_mocs, DEFAULT_PAT_INDEX, M_LINEAR,
+			   region, src_mocs, DEFAULT_PAT_INDEX, TYPE_LINEAR,
 			   COMPRESSION_DISABLED);
 	blt_set_mem_object(&mem.dst, dst_handle, size, width, width, height,
-			   region, dst_mocs, DEFAULT_PAT_INDEX, M_LINEAR,
+			   region, dst_mocs, DEFAULT_PAT_INDEX, TYPE_LINEAR,
 			   COMPRESSION_DISABLED);
 	mem.src.ptr = xe_bo_map(fd, src_handle, size);
 	mem.dst.ptr = xe_bo_map(fd, dst_handle, size);
@@ -109,7 +109,7 @@ mem_set(int fd, uint32_t dst_handle, const intel_ctx_t *ctx, uint32_t size,
 	bb = xe_bo_create(fd, 0, bb_size, region, 0);
 	blt_mem_init(fd, &mem);
 	blt_set_mem_object(&mem.dst, dst_handle, size, width, width, height, region,
-			   dst_mocs, DEFAULT_PAT_INDEX, M_LINEAR, COMPRESSION_DISABLED);
+			   dst_mocs, DEFAULT_PAT_INDEX, TYPE_LINEAR, COMPRESSION_DISABLED);
 	mem.dst.ptr = xe_bo_map(fd, dst_handle, size);
 	blt_set_batch(&mem.bb, bb, bb_size, region);
 	blt_mem_set(fd, ctx, NULL, ahnd, &mem, fill_data);
diff --git a/tests/intel/xe_render_copy.c b/tests/intel/xe_render_copy.c
index 60cd0fb457..7ebde01c44 100644
--- a/tests/intel/xe_render_copy.c
+++ b/tests/intel/xe_render_copy.c
@@ -470,10 +470,10 @@ static void mem_copy_busy(int fd, struct drm_xe_engine_class_instance *hwe, uint
 	dst_handle = xe_bo_create(fd, 0, copy_size, region, 0);
 	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);
+			   TYPE_LINEAR, COMPRESSION_DISABLED);
 	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);
+			   TYPE_LINEAR, COMPRESSION_DISABLED);
 	mem_copy.src->ptr = xe_bo_map(fd, src_handle, copy_size);
 	mem_copy.dst->ptr = xe_bo_map(fd, dst_handle, copy_size);
 	mem_copy.src_offset = get_offset_pat_index(ahnd, mem_copy.src->handle,
diff --git a/tests/intel/xe_spin_batch.c b/tests/intel/xe_spin_batch.c
index 4fff34a092..06c5f9d3f9 100644
--- a/tests/intel/xe_spin_batch.c
+++ b/tests/intel/xe_spin_batch.c
@@ -351,10 +351,10 @@ static void xe_spin_mem_copy_region(int fd, struct drm_xe_engine_class_instance
 	dst_handle = xe_bo_create(fd, 0, copy_size, region, 0);
 	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);
+			   TYPE_LINEAR, COMPRESSION_DISABLED);
 	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);
+			   TYPE_LINEAR, COMPRESSION_DISABLED);
 	mem_copy.src->ptr = xe_bo_map(fd, src_handle, copy_size);
 	mem_copy.dst->ptr = xe_bo_map(fd, dst_handle, copy_size);
 	mem_copy.src_offset = get_offset_pat_index(ahnd, mem_copy.src->handle,
-- 
2.43.0



More information about the igt-dev mailing list