[PATCH i-g-t 07/15] lib/intel_cmds_info: add blt_memop_mode (byte/page)

Francois Dugast francois.dugast at intel.com
Mon May 19 08:54:47 UTC 2025


On Tue, May 13, 2025 at 08:58:02PM +0200, Zbigniew Kempczyński wrote:
> Add 'mode' field for further extending in tests.
> 
> Signed-off-by: Zbigniew Kempczyński <zbigniew.kempczynski at intel.com>
> Cc: Francois Dugast <francois.dugast at intel.com>
> ---
>  lib/intel_blt.c             | 3 +++
>  lib/intel_blt.h             | 2 ++
>  lib/intel_cmds_info.h       | 5 +++++
>  tests/intel/xe_copy_basic.c | 2 +-
>  4 files changed, 11 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 66f63d7e72..bcaad6053a 100644
> --- a/lib/intel_cmds_info.h
> +++ b/lib/intel_cmds_info.h
> @@ -24,6 +24,11 @@ enum blt_memop_type {
>  	TYPE_MATRIX,
>  };
>  
> +enum blt_memop_mode {
> +	MODE_BYTE,
> +	MODE_PAGE,
> +};
> +

The name gives some hint but it would be helpful to document what it is
intended for, especially given that it is not used until patch 9/15 in
the series.

>  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