[Mesa-dev] [PATCH] intel/isl: Add assertion for aux surface pitch

Nanley Chery nanleychery at gmail.com
Wed Feb 7 00:22:43 UTC 2018


On Mon, Feb 05, 2018 at 04:07:19PM -0800, Anuj Phogat wrote:
> I don't have a test case hitting this assert. But, it's nice to have
> an assert checking the limit.
> 
> Signed-off-by: Anuj Phogat <anuj.phogat at gmail.com>
> ---
>  src/intel/isl/isl_surface_state.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/src/intel/isl/isl_surface_state.c b/src/intel/isl/isl_surface_state.c
> index bfb27fa4a4..afd4b80ddb 100644
> --- a/src/intel/isl/isl_surface_state.c
> +++ b/src/intel/isl/isl_surface_state.c
> @@ -566,6 +566,8 @@ isl_genX(surf_fill_state_s)(const struct isl_device *dev, void *state,
>        s.AuxiliarySurfaceBaseAddress = info->aux_address;
>        s.AuxiliarySurfacePitch = pitch_in_tiles - 1;
>  
> +      assert(s.AuxiliarySurfacePitch <= 511);
> +

genxml already performs this assertion for us, see:
__gen_uint(values->AuxiliarySurfacePitch, 3, 11)


>  #if GEN_GEN >= 8
>        assert(GEN_GEN >= 9 || info->aux_usage != ISL_AUX_USAGE_CCS_E);
>        /* Auxiliary surfaces in ISL have compressed formats but the hardware
> -- 
> 2.13.6
> 
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev


More information about the mesa-dev mailing list