[PATCH i-g-t 04/15] tests/xe_copy_basic: use non-zero pitch

Francois Dugast francois.dugast at intel.com
Mon May 19 07:57:25 UTC 2025


On Tue, May 13, 2025 at 08:57:59PM +0200, Zbigniew Kempczyński wrote:
> Passing zero leads to use turn all bits on what's incorrect. Pass
> width as pitch to avoid undefined behavior in mem-copy and mem-set.
> 
> Signed-off-by: Zbigniew Kempczyński <zbigniew.kempczynski at intel.com>
> Cc: Francois Dugast <francois.dugast at intel.com>

Reviewed-by: Francois Dugast <francois.dugast at intel.com>

> ---
>  tests/intel/xe_copy_basic.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/tests/intel/xe_copy_basic.c b/tests/intel/xe_copy_basic.c
> index a43842e398..d4300b85c0 100644
> --- a/tests/intel/xe_copy_basic.c
> +++ b/tests/intel/xe_copy_basic.c
> @@ -57,10 +57,10 @@ 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_init(fd, &mem);
> -	blt_set_mem_object(&mem.src, src_handle, size, 0, width, height,
> +	blt_set_mem_object(&mem.src, src_handle, size, width, width, height,
>  			   region, src_mocs, DEFAULT_PAT_INDEX, M_LINEAR,
>  			   COMPRESSION_DISABLED);
> -	blt_set_mem_object(&mem.dst, dst_handle, size, 0, width, height,
> +	blt_set_mem_object(&mem.dst, dst_handle, size, width, width, height,
>  			   region, dst_mocs, DEFAULT_PAT_INDEX, M_LINEAR,
>  			   COMPRESSION_DISABLED);
>  	mem.src.ptr = xe_bo_map(fd, src_handle, size);
> @@ -108,7 +108,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, 0, width, height, region,
> +	blt_set_mem_object(&mem.dst, dst_handle, size, width, width, height, region,
>  			   dst_mocs, DEFAULT_PAT_INDEX, M_LINEAR, COMPRESSION_DISABLED);
>  	mem.dst.ptr = xe_bo_map(fd, dst_handle, size);
>  	blt_set_batch(&mem.bb, bb, bb_size, region);
> -- 
> 2.43.0
> 


More information about the igt-dev mailing list