[PATCH 1/5] drm/xe/rtp: Allow to match 0 sr entries

Matt Roper matthew.d.roper at intel.com
Mon Jun 17 18:49:14 UTC 2024


On Mon, Jun 17, 2024 at 11:25:14AM -0700, Lucas De Marchi wrote:
> If none of the rules match, there should be 0 entriese in the sr xarray,
> so none of them should have a register matching.
> 
> Signed-off-by: Lucas De Marchi <lucas.demarchi at intel.com>

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

> ---
>  drivers/gpu/drm/xe/tests/xe_rtp_test.c | 11 ++++++++---
>  1 file changed, 8 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/gpu/drm/xe/tests/xe_rtp_test.c b/drivers/gpu/drm/xe/tests/xe_rtp_test.c
> index 06759d754783..474a0b222ce1 100644
> --- a/drivers/gpu/drm/xe/tests/xe_rtp_test.c
> +++ b/drivers/gpu/drm/xe/tests/xe_rtp_test.c
> @@ -255,9 +255,14 @@ static void xe_rtp_process_tests(struct kunit *test)
>  	}
>  
>  	KUNIT_EXPECT_EQ(test, count, param->expected_count);
> -	KUNIT_EXPECT_EQ(test, sr_entry->clr_bits, param->expected_clr_bits);
> -	KUNIT_EXPECT_EQ(test, sr_entry->set_bits, param->expected_set_bits);
> -	KUNIT_EXPECT_EQ(test, sr_entry->reg.raw, param->expected_reg.raw);
> +	if (count) {
> +		KUNIT_EXPECT_EQ(test, sr_entry->clr_bits, param->expected_clr_bits);
> +		KUNIT_EXPECT_EQ(test, sr_entry->set_bits, param->expected_set_bits);
> +		KUNIT_EXPECT_EQ(test, sr_entry->reg.raw, param->expected_reg.raw);
> +	} else {
> +		KUNIT_EXPECT_NULL(test, sr_entry);
> +	}
> +
>  	KUNIT_EXPECT_EQ(test, reg_sr->errors, param->expected_sr_errors);
>  }
>  
> -- 
> 2.43.0
> 

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


More information about the Intel-xe mailing list