[igt-dev] [PATCH i-g-t 3/4] lib/rendercopy: separate intel clear color functions

Kahola, Mika mika.kahola at intel.com
Tue Oct 4 09:20:35 UTC 2022


> -----Original Message-----
> From: igt-dev <igt-dev-bounces at lists.freedesktop.org> On Behalf Of Juha-
> Pekka Heikkila
> Sent: Tuesday, September 27, 2022 10:12 PM
> To: igt-dev at lists.freedesktop.org
> Subject: [igt-dev] [PATCH i-g-t 3/4] lib/rendercopy: separate intel clear color
> functions
> 
> separate dg2 style ccs clear color from generic gen12 clear color same way as
> how they're separate on rendercopy.
> 

Reviewed-by: Mika Kahola <mika.kahola at intel.com>

> Signed-off-by: Juha-Pekka Heikkila <juhapekka.heikkila at gmail.com>
> ---
>  lib/intel_batchbuffer.c |  8 +++++++-
>  lib/rendercopy.h        |  4 ++++
>  lib/rendercopy_gen9.c   | 45 +++++++++++++++++++++++------------------
>  3 files changed, 36 insertions(+), 21 deletions(-)
> 
> diff --git a/lib/intel_batchbuffer.c b/lib/intel_batchbuffer.c index
> ef1b59477..bb2503bbd 100644
> --- a/lib/intel_batchbuffer.c
> +++ b/lib/intel_batchbuffer.c
> @@ -1166,7 +1166,13 @@ igt_vebox_copyfunc_t igt_get_vebox_copyfunc(int
> devid)
> 
>  igt_render_clearfunc_t igt_get_render_clearfunc(int devid)  {
> -	return IS_GEN12(devid) ? gen12_render_clearfunc : NULL;
> +	if (IS_DG2(devid)) {
> +		return gen12p71_render_clearfunc;
> +	} else if (IS_GEN12(devid)) {
> +		return gen12_render_clearfunc;
> +	} else {
> +		return NULL;
> +	}
>  }
> 
>  /**
> diff --git a/lib/rendercopy.h b/lib/rendercopy.h index 3e984a141..480fdee8d
> 100644
> --- a/lib/rendercopy.h
> +++ b/lib/rendercopy.h
> @@ -23,6 +23,10 @@ static inline void emit_vertex_normalized(struct intel_bb
> *ibb,
>  	intel_bb_out(ibb, u.ui);
>  }
> 
> +void gen12p71_render_clearfunc(struct intel_bb *ibb,
> +			       struct intel_buf *dst, unsigned int dst_x, unsigned
> int dst_y,
> +			       unsigned int width, unsigned int height,
> +			       const float clear_color[4]);
>  void gen12_render_clearfunc(struct intel_bb *ibb,
>  			    struct intel_buf *dst, unsigned int dst_x, unsigned int
> dst_y,
>  			    unsigned int width, unsigned int height, diff --git
> a/lib/rendercopy_gen9.c b/lib/rendercopy_gen9.c index ae0f775ac..d74f1c999
> 100644
> --- a/lib/rendercopy_gen9.c
> +++ b/lib/rendercopy_gen9.c
> @@ -1254,24 +1254,29 @@ void gen12_render_clearfunc(struct intel_bb *ibb,
>  			    unsigned int width, unsigned int height,
>  			    const float clear_color[4])
>  {
> -	if (!HAS_4TILE(ibb->devid)) {
> -		struct aux_pgtable_info pgtable_info = { };
> -
> -		gen12_aux_pgtable_init(&pgtable_info, ibb, NULL, dst);
> -
> -		_gen9_render_op(ibb, NULL, 0, 0,
> -				width, height, dst, dst_x, dst_y,
> -				pgtable_info.pgtable_buf,
> -				clear_color,
> -				gen12_render_copy,
> -				sizeof(gen12_render_copy));
> -		gen12_aux_pgtable_cleanup(ibb, &pgtable_info);
> -	} else {
> -			_gen9_render_op(ibb, NULL, 0, 0,
> -					width, height, dst, dst_x, dst_y,
> -					NULL,
> -					clear_color,
> -					gen12p71_render_copy,
> -					sizeof(gen12p71_render_copy));
> -	}
> +	struct aux_pgtable_info pgtable_info = { };
> +
> +	gen12_aux_pgtable_init(&pgtable_info, ibb, NULL, dst);
> +
> +	_gen9_render_op(ibb, NULL, 0, 0,
> +			width, height, dst, dst_x, dst_y,
> +			pgtable_info.pgtable_buf,
> +			clear_color,
> +			gen12_render_copy,
> +			sizeof(gen12_render_copy));
> +	gen12_aux_pgtable_cleanup(ibb, &pgtable_info); }
> +
> +void gen12p71_render_clearfunc(struct intel_bb *ibb,
> +			       struct intel_buf *dst,
> +			       unsigned int dst_x, unsigned int dst_y,
> +			       unsigned int width, unsigned int height,
> +			       const float clear_color[4])
> +{
> +	_gen9_render_op(ibb, NULL, 0, 0,
> +			width, height, dst, dst_x, dst_y,
> +			NULL,
> +			clear_color,
> +			gen12p71_render_copy,
> +			sizeof(gen12p71_render_copy));
>  }
> --
> 2.37.3



More information about the igt-dev mailing list