[PATCH i-g-t v4 03/11] lib/intel_cmds_info: add blt_memop_mode (byte/page)

Zbigniew Kempczyński zbigniew.kempczynski at intel.com
Fri May 30 06:40:42 UTC 2025


Add 'mode' field for further extending in tests. It is used for
mem-copy linear type which supports copy mode in bytes or pages.

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             |  3 +++
 lib/intel_blt.h             |  2 ++
 lib/intel_cmds_info.h       | 11 +++++++++++
 tests/intel/xe_copy_basic.c |  2 +-
 4 files changed, 17 insertions(+), 1 deletion(-)

diff --git a/lib/intel_blt.c b/lib/intel_blt.c
index 4c90d157c9..6bfaf09a2b 100644
--- a/lib/intel_blt.c
+++ b/lib/intel_blt.c
@@ -1802,18 +1802,21 @@ int blt_fast_copy(int fd,
  * blt_mem_copy_init:
  * @fd: drm fd
  * @mem: structure for initialization
+ * @mode: copy mode - byte or page (256B)
  * @copy_type: linear or matrix
  *
  * Function is zeroing @mem and sets fd and driver fields (INTEL_DRIVER_I915 or
  * INTEL_DRIVER_XE).
  */
 void blt_mem_copy_init(int fd, struct blt_mem_copy_data *mem,
+		       enum blt_memop_mode mode,
 		       enum blt_memop_type copy_type)
 {
 	memset(mem, 0, sizeof(*mem));
 
 	mem->fd = fd;
 	mem->driver = get_intel_driver(fd);
+	mem->mode = mode;
 	mem->copy_type = copy_type;
 }
 
diff --git a/lib/intel_blt.h b/lib/intel_blt.h
index 9efa799881..f2509ab175 100644
--- a/lib/intel_blt.h
+++ b/lib/intel_blt.h
@@ -130,6 +130,7 @@ struct blt_copy_data {
 struct blt_mem_copy_data {
 	int fd;
 	enum intel_driver driver;
+	enum blt_memop_mode mode;
 	enum blt_memop_type copy_type;
 	struct blt_mem_object src;
 	struct blt_mem_object dst;
@@ -274,6 +275,7 @@ int blt_fast_copy(int fd,
 		  const struct blt_copy_data *blt);
 
 void blt_mem_copy_init(int fd, struct blt_mem_copy_data *mem,
+		       enum blt_memop_mode mode,
 		       enum blt_memop_type copy_type);
 
 void blt_mem_set_init(int fd, struct blt_mem_set_data *mem,
diff --git a/lib/intel_cmds_info.h b/lib/intel_cmds_info.h
index 88ba892645..17f60ce912 100644
--- a/lib/intel_cmds_info.h
+++ b/lib/intel_cmds_info.h
@@ -30,6 +30,17 @@ enum blt_memop_type {
 	TYPE_MATRIX,
 };
 
+/**
+ * enum blt_memop_mode - memory operation mode mem-copy.
+ *
+ * Mem-copy with linear type supports mode operation in bytes or pages
+ * (page is 256B chunk).
+ */
+enum blt_memop_mode {
+	MODE_BYTE,
+	MODE_PAGE,
+};
+
 enum blt_cmd_type {
 	SRC_COPY,
 	MEM_SET,
diff --git a/tests/intel/xe_copy_basic.c b/tests/intel/xe_copy_basic.c
index 5681d4d6ab..f252d29fd4 100644
--- a/tests/intel/xe_copy_basic.c
+++ b/tests/intel/xe_copy_basic.c
@@ -56,7 +56,7 @@ mem_copy(int fd, uint32_t src_handle, uint32_t dst_handle, const intel_ctx_t *ct
 
 	bb = xe_bo_create(fd, 0, bb_size, region, 0);
 
-	blt_mem_copy_init(fd, &mem, TYPE_LINEAR);
+	blt_mem_copy_init(fd, &mem, MODE_BYTE, TYPE_LINEAR);
 	blt_set_mem_object(&mem.src, src_handle, size, width, width, height,
 			   region, src_mocs, DEFAULT_PAT_INDEX, COMPRESSION_DISABLED);
 	blt_set_mem_object(&mem.dst, dst_handle, size, width, width, height,
-- 
2.43.0



More information about the igt-dev mailing list