[igt-dev] [PATCH i-g-t] tests/i915/api_intel_allocator: change copy instruction for new gens

Zbigniew Kempczyński zbigniew.kempczynski at intel.com
Thu Feb 24 08:53:14 UTC 2022


On Fri, Feb 18, 2022 at 08:46:51PM +0100, Kamil Konieczny wrote:
> Use XY_FAST_COPY_BLT on newer GPU generations.
> 
> Signed-off-by: Kamil Konieczny <kamil.konieczny at linux.intel.com>
> Cc: Zbigniew Kempczyński <zbigniew.kempczynski at intel.com>
> ---
>  tests/i915/api_intel_allocator.c | 23 ++++++++++++++---------
>  1 file changed, 14 insertions(+), 9 deletions(-)
> 
> diff --git a/tests/i915/api_intel_allocator.c b/tests/i915/api_intel_allocator.c
> index bb1b3838..487eafce 100644
> --- a/tests/i915/api_intel_allocator.c
> +++ b/tests/i915/api_intel_allocator.c
> @@ -575,15 +575,20 @@ static void execbuf_with_allocator(int fd)
>  
>  	/* Blit src -> dst */
>  	i = 0;
> -	batch[i++] = XY_SRC_COPY_BLT_CMD |
> -		  XY_SRC_COPY_BLT_WRITE_ALPHA |
> -		  XY_SRC_COPY_BLT_WRITE_RGB;
> -	if (gen >= 8)
> -		batch[i - 1] |= 8;
> -	else
> -		batch[i - 1] |= 6;
> -
> -	batch[i++] = (3 << 24) | (0xcc << 16) | 4;
> +	if (gen >= 9) {
> +		batch[i++] = XY_FAST_COPY_BLT; /* No tiling */
> +		batch[i++] = XY_FAST_COPY_COLOR_DEPTH_32 | 0x10;
> +	} else {
> +		batch[i++] = XY_SRC_COPY_BLT_CMD |
> +			  XY_SRC_COPY_BLT_WRITE_ALPHA |
> +			  XY_SRC_COPY_BLT_WRITE_RGB;
> +		if (gen >= 8)
> +			batch[i - 1] |= 8;
> +		else
> +			batch[i - 1] |= 6;
> +
> +		batch[i++] = (3 << 24) | (0xcc << 16) | 4;
> +	}
>  	batch[i++] = 0;
>  	batch[i++] = (1 << 16) | 4;
>  	batch[i++] = object[1].offset;
> -- 
> 2.32.0
>

Looks good.

Reviewed-by: Zbigniew Kempczyński <zbigniew.kempczynski at intel.com>

--
Zbigniew 


More information about the igt-dev mailing list