[igt-dev] [PATCH i-g-t v4 24/25] tests/i915/gem_ppgtt: make copying more readable

Zbigniew Kempczyński zbigniew.kempczynski at intel.com
Mon Sep 28 07:53:06 UTC 2020


On Tue, Sep 22, 2020 at 01:52:28PM +0200, Dominik Grzegorzek wrote:
> Use intel_bb_copy_intel_buf instead of intel_bb_blit_copy
> to make the code simplier.
> 
> Signed-off-by: Dominik Grzegorzek <dominik.grzegorzek at intel.com>
> Cc: Zbigniew Kempczyński <zbigniew.kempczynski at intel.com>
> Cc: Chris Wilson <chris at chris-wilson.co.uk>
> ---
>  tests/i915/gem_ppgtt.c | 16 ++++------------
>  1 file changed, 4 insertions(+), 12 deletions(-)
> 
> diff --git a/tests/i915/gem_ppgtt.c b/tests/i915/gem_ppgtt.c
> index 949601ac..8d7e1a81 100644
> --- a/tests/i915/gem_ppgtt.c
> +++ b/tests/i915/gem_ppgtt.c
> @@ -165,12 +165,8 @@ static void fork_bcs_copy(int timeout, uint32_t final,
>  			src[1] = create_bo(dst[child]->bops,
>  					   i++ | child << 16);
>  
> -			intel_bb_blt_copy(ibb, src[1], 0, 0, 4096,
> -					  src[0], 0, 0, 4096,
> -					  4096/4, SIZE/4096, 32);
> -			intel_bb_blt_copy(ibb, src[0], 0, 0, 4096,
> -					  dst[child], 0, 0, 4096,
> -					  4096/4, SIZE/4096, 32);
> +			intel_bb_copy_intel_buf(ibb, src[0], src[1], SIZE);
> +			intel_bb_copy_intel_buf(ibb, dst[child], src[0], SIZE);
>  
>  			intel_buf_destroy(src[1]);
>  			intel_buf_destroy(src[0]);
> @@ -180,12 +176,8 @@ static void fork_bcs_copy(int timeout, uint32_t final,
>  		src[1] = create_bo(dst[child]->bops,
>  				   final | child << 16);
>  
> -		intel_bb_blt_copy(ibb, src[1], 0, 0, 4096,
> -				  src[0], 0, 0, 4096,
> -				  4096/4, SIZE/4096, 32);
> -		intel_bb_blt_copy(ibb, src[0], 0, 0, 4096,
> -				  dst[child], 0, 0, 4096,
> -				  4096/4, SIZE/4096, 32);
> +		intel_bb_copy_intel_buf(ibb, src[0], src[1], SIZE);
> +		intel_bb_copy_intel_buf(ibb, dst[child], src[0], SIZE);

I just realized intel_bb_blt_copy() uses src -> dst, but here we have
dst <- src which can be confusing in the future. 

As intel_bb_copy_intel_buf() is not yet merged I suggest to change 
arguments order to be consistent in intel_bb_blt_copy() api.

--
Zbigniew

>  
>  		intel_buf_destroy(src[1]);
>  		intel_buf_destroy(src[0]);
> -- 
> 2.20.1
> 


More information about the igt-dev mailing list