[PATCH i-g-t 2/2] tests/intel/xe_gt_freq: Skip GuC PC tests if GuC PC not supported

Belgaumkar, Vinay vinay.belgaumkar at intel.com
Sat Jan 20 01:26:53 UTC 2024


On 1/19/2024 9:04 AM, Badal Nilawar wrote:
> Skip GuC PC tests if platform does not support SLPC.
>
> v2: Use scalable approach (Anshuman)
>
> Fixes: acaaca0bf317 ("tests/xe: Add Xe IGT tests")
> Signed-off-by: Badal Nilawar <badal.nilawar at intel.com>
> ---
>   tests/intel/xe_gt_freq.c | 8 ++++++++
>   1 file changed, 8 insertions(+)
>
> diff --git a/tests/intel/xe_gt_freq.c b/tests/intel/xe_gt_freq.c
> index bf63e4298..6c4fc81ae 100644
> --- a/tests/intel/xe_gt_freq.c
> +++ b/tests/intel/xe_gt_freq.c
> @@ -319,6 +319,11 @@ static void test_reset(int fd, int gt_id, int cycles)
>   	}
>   }
>   
> +static bool xe_is_slpc_enabled(int drm_fd)
> +{
> +	return igt_debugfs_search(drm_fd, "info", "skip_guc_pc yes");
> +}

the function is called is_slpc_enabled() but returns false when it is 
indeed enabled (skip_guc_pc = false). Might be better to search for 
"skip_guc_pc false" instead?

Thanks,

Vinay.

> +
>   igt_main
>   {
>   	int fd;
> @@ -329,6 +334,9 @@ igt_main
>   	igt_fixture {
>   		fd = drm_open_driver(DRIVER_XE);
>   
> +		igt_skip_on_f(!xe_is_slpc_enabled(fd),
> +			      "GuC PC tests are not supported when SLPC is disabled\n");
> +
>   		/* The defaults are the same. Stashing the gt0 is enough */
>   		stash_min = get_freq(fd, 0, "min");
>   		stash_max = get_freq(fd, 0, "max");


More information about the igt-dev mailing list