[PATCH i-g-t] tests/intel/xe_pm_residency: assert only if idle residency is lesser than elapsed time

Gupta, Anshuman anshuman.gupta at intel.com
Tue Dec 12 09:57:28 UTC 2023



> -----Original Message-----
> From: Tauro, Riana <riana.tauro at intel.com>
> Sent: Tuesday, December 12, 2023 3:05 PM
> To: igt-dev at lists.freedesktop.org
> Cc: Tauro, Riana <riana.tauro at intel.com>; Gupta, Anshuman
> <anshuman.gupta at intel.com>; Nilawar, Badal <badal.nilawar at intel.com>
> Subject: [PATCH i-g-t] tests/intel/xe_pm_residency: assert only if idle residency is
> lesser than elapsed time
> 
> When device is suspended (system suspend or runtime suspend), device needs to
> be woken up to read residency.
> Idle residency may increase above tolerance based on the resume time, thus
> being greater than elapsed ms.
> 
> assert only if idle residency is less than elapsed time and not within tolerance.
> 
> Signed-off-by: Riana Tauro <riana.tauro at intel.com>
Reviewed-by: Anshuman Gupta <anshuman.gupta at intel.com>
> ---
>  tests/intel/xe_pm_residency.c | 15 ++++++++-------
>  1 file changed, 8 insertions(+), 7 deletions(-)
> 
> diff --git a/tests/intel/xe_pm_residency.c b/tests/intel/xe_pm_residency.c index
> 5542f8fb4..7db3cd162 100644
> --- a/tests/intel/xe_pm_residency.c
> +++ b/tests/intel/xe_pm_residency.c
> @@ -204,13 +204,6 @@ static void test_idle_residency(int fd, int gt, enum
> test_type flag)
>  		residency_start = read_idle_residency(fd, gt);
>  		igt_system_suspend_autoresume(SUSPEND_STATE_FREEZE,
> SUSPEND_TEST_NONE);
>  		residency_end = read_idle_residency(fd, gt);
> -
> -		/*
> -		 * Idle residency may increase even after suspend, only assert if
> residency
> -		 * is lesser than autoresume delay and is not within tolerance.
> -		 */
> -		if ((residency_end - residency_start) >= elapsed_ms)
> -			return;
>  	}
> 
>  	if (flag == TEST_IDLE) {
> @@ -222,6 +215,14 @@ static void test_idle_residency(int fd, int gt, enum
> test_type flag)
>  	igt_info("Measured %lums of idle residency in %lums\n",
>  		 residency_end - residency_start, elapsed_ms);
> 
> +	/*
> +	 * When suspended (system or runtime suspend), device needs to be
> woken up to read
> +	 * residency. Idle residency may increase during resume thus being
> greater than
> +	 * elapsed ms.
> +	 */
> +	if ((residency_end - residency_start) >= elapsed_ms)
> +		return;
> +
>  	assert_within_epsilon(residency_end - residency_start, elapsed_ms,
> tolerance);  }
> 
> --
> 2.40.0



More information about the igt-dev mailing list