[i-g-t 2/4] tests/intel/xe_exec_threads: remove redundant wait

Matt Roper matthew.d.roper at intel.com
Tue Nov 5 23:59:15 UTC 2024


On Wed, Oct 30, 2024 at 04:03:48PM -0700, fei.yang at intel.com wrote:
> From: Fei Yang <fei.yang at intel.com>
> 
> The for-loop for REBIND case accidentally wait twice for the execs of
> 0x20*n interations. Copyi paste the code from INVALIDATE case which is
> correct.
> 
> Signed-off-by: Fei Yang <fei.yang at intel.com>

I'm not super wild about the non-intuitive loop logic (even in the
INVALIDATE case that we're copying from), but this does solve the
unwanted overlap and also makes the two spots in the code consistent.

Reviewed-by: Matt Roper <matthew.d.roper at intel.com>

Maybe we can come back later and write these loops in a more clear
manner.


Matt

> ---
>  tests/intel/xe_exec_threads.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/tests/intel/xe_exec_threads.c b/tests/intel/xe_exec_threads.c
> index 413d6626b..962957cd7 100644
> --- a/tests/intel/xe_exec_threads.c
> +++ b/tests/intel/xe_exec_threads.c
> @@ -340,7 +340,7 @@ test_compute_mode(int fd, uint32_t vm, uint64_t addr, uint64_t userptr,
>  		xe_exec(fd, &exec);
>  
>  		if (flags & REBIND && i && !(i & 0x1f)) {
> -			for (j = i - 0x20; j <= i; ++j)
> +			for (j = i == 0x20 ? 0 : i - 0x1f; j <= i; ++j)
>  				xe_wait_ufence(fd, &data[j].exec_sync,
>  					       USER_FENCE_VALUE,
>  					       exec_queues[e], fence_timeout);
> -- 
> 2.25.1
> 

-- 
Matt Roper
Graphics Software Engineer
Linux GPU Platform Enablement
Intel Corporation


More information about the igt-dev mailing list