[PATCH i-g-t 2/2] tests/xe_render_copy: change width and pitch to be in valid range

Francois Dugast francois.dugast at intel.com
Mon May 12 07:55:08 UTC 2025


On Fri, May 09, 2025 at 09:46:45AM +0200, Zbigniew Kempczyński wrote:
> For mem-copy (byte mode) width and pitch must be lesser or equal 256K.
> Limit them avoiding setting inappropriate bits in mem-copy operation.

Maybe a comma would help: "Limit them, avoiding...".

> 
> Signed-off-by: Zbigniew Kempczyński <zbigniew.kempczynski at intel.com>
> Cc: Francois Dugast <francois.dugast at intel.com>
> ---
>  tests/intel/xe_render_copy.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/tests/intel/xe_render_copy.c b/tests/intel/xe_render_copy.c
> index fadfd162ce..9f16537c1e 100644
> --- a/tests/intel/xe_render_copy.c
> +++ b/tests/intel/xe_render_copy.c
> @@ -445,7 +445,7 @@ static void mem_copy_busy(int fd, struct drm_xe_engine_class_instance *hwe, uint
>  			  uint64_t ahnd, uint32_t region, struct xe_spin **spin,
>  			  pthread_mutex_t *lock_init_spin)
>  {
> -	uint32_t copy_size = SZ_4M;
> +	uint32_t copy_size = SZ_256K;

This matches the commit message.

>  	/* Keep below 5 s timeout */
>  	uint64_t duration_ns = NSEC_PER_SEC * 4.5;
>  	intel_ctx_t *ctx;
> @@ -468,10 +468,10 @@ static void mem_copy_busy(int fd, struct drm_xe_engine_class_instance *hwe, uint
>  	/* 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,

Why changing the pitch value here and below?

Francois

>  			   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