public inbox for igt-dev@lists.freedesktop.org
 help / color / mirror / Atom feed
From: Janusz Krzysztofik <janusz.krzysztofik@linux.intel.com>
To: Krzysztof Niemiec <krzysztof.niemiec@intel.com>,
	 igt-dev@lists.freedesktop.org
Cc: Andi Shyti <andi.shyti@linux.intel.com>,
	Krzysztof Karas	 <krzysztof.karas@intel.com>,
	Sebastian Brzezinka <sebastian.brzezinka@intel.com>
Subject: Re: [PATCH i-g-t v3] tests/intel/gem_exec_endless: Use the per-gt interface to set frequencies
Date: Fri, 10 Apr 2026 14:16:33 +0200	[thread overview]
Message-ID: <80fb52072aec29387944507afc63ceda0fc72210.camel@linux.intel.com> (raw)
In-Reply-To: <20260409140640.48827-2-krzysztof.niemiec@intel.com>

On Thu, 2026-04-09 at 16:06 +0200, Krzysztof Niemiec wrote:
> The test alters the environment, specifically the gt frequencies, for
> its duration. Using the legacy interface however makes it impossible for
> the pre-test state to be restored due to its limitations in multi-gt
> systems; by using the legacy interface only a single value can be set,
> but each gt might accept values from a different range and default to
> a different value that we might want to restore.
> 
> Use the per-gt interface instead of the legacy one to properly clean up.
> 
> Signed-off-by: Krzysztof Niemiec <krzysztof.niemiec@intel.com>

Reviewed-by: Janusz Krzysztofik <janusz.krzysztofik@linux.intel.com>

NIT: Please note we have a habit, in IGT and i915 at least, of including
change logs into commit descriptions.

Thanks,
Janusz


> ---
> 
> v3:
>   - Expand the commit description for extra clarity (Janusz)
> 
> v2:
>   - Remove the redundant fd open from the i915_for_each_gt loop, as one
>     is already created as part of the loop (Sebastian)
>   - Remove extra newline (Krzysztof K)
> 
>  tests/intel/gem_exec_endless.c | 33 +++++++++++++++++----------------
>  1 file changed, 17 insertions(+), 16 deletions(-)
> 
> diff --git a/tests/intel/gem_exec_endless.c b/tests/intel/gem_exec_endless.c
> index 7f35e985c..f3ed8556c 100644
> --- a/tests/intel/gem_exec_endless.c
> +++ b/tests/intel/gem_exec_endless.c
> @@ -316,28 +316,28 @@ static void endless_dispatch(int i915, const struct intel_execution_engine2 *e)
>  		for_each_if(gem_class_can_store_dword(i915, (e)->class)) \
>  			igt_dynamic_f("%s", (e)->name)
>  
> -static void pin_rps(int sysfs)
> +static void pin_rps(int sysfs_gt)
>  {
>  	unsigned int max;
>  
> -	if (igt_sysfs_scanf(sysfs, "gt_RP0_freq_mhz", "%u", &max) != 1)
> +	if (igt_sysfs_scanf(sysfs_gt, "rps_RP0_freq_mhz", "%u", &max) != 1)
>  		return;
>  
> -	igt_sysfs_printf(sysfs, "gt_min_freq_mhz", "%u", max);
> -	igt_sysfs_printf(sysfs, "gt_max_freq_mhz", "%u", max);
> -	igt_sysfs_printf(sysfs, "gt_boost_freq_mhz", "%u", max);
> +	igt_sysfs_printf(sysfs_gt, "rps_min_freq_mhz", "%u", max);
> +	igt_sysfs_printf(sysfs_gt, "rps_max_freq_mhz", "%u", max);
> +	igt_sysfs_printf(sysfs_gt, "rps_boost_freq_mhz", "%u", max);
>  }
>  
> -static void unpin_rps(int sysfs)
> +static void unpin_rps(int sysfs_gt)
>  {
>  	unsigned int v;
>  
> -	if (igt_sysfs_scanf(sysfs, "gt_RPn_freq_mhz", "%u", &v) == 1)
> -		igt_sysfs_printf(sysfs, "gt_min_freq_mhz", "%u", v);
> +	if (igt_sysfs_scanf(sysfs_gt, "rps_RPn_freq_mhz", "%u", &v) == 1)
> +		igt_sysfs_printf(sysfs_gt, "rps_min_freq_mhz", "%u", v);
>  
> -	if (igt_sysfs_scanf(sysfs, "gt_RP0_freq_mhz", "%u", &v) == 1) {
> -		igt_sysfs_printf(sysfs, "gt_max_freq_mhz", "%u", v);
> -		igt_sysfs_printf(sysfs, "gt_boost_freq_mhz", "%u", v);
> +	if (igt_sysfs_scanf(sysfs_gt, "rps_RP0_freq_mhz", "%u", &v) == 1) {
> +		igt_sysfs_printf(sysfs_gt, "rps_max_freq_mhz", "%u", v);
> +		igt_sysfs_printf(sysfs_gt, "rps_boost_freq_mhz", "%u", v);
>  	}
>  }
>  
> @@ -355,7 +355,7 @@ int igt_main()
>  
>  	igt_subtest_group() {
>  		struct intel_mmio_data mmio;
> -		int sysfs;
> +		int sysfs_gt, gt;
>  
>  		igt_fixture() {
>  			igt_require(gem_scheduler_enabled(i915));
> @@ -365,16 +365,17 @@ int igt_main()
>  						   igt_device_get_pci_device(i915),
>  						   false);
>  
> -			sysfs = igt_sysfs_open(i915);
> -			pin_rps(sysfs);
> +			i915_for_each_gt(i915, sysfs_gt, gt)
> +				pin_rps(sysfs_gt);
>  		}
>  
>  		test_each_engine("dispatch", i915, e)
>  				endless_dispatch(i915, e);
>  
>  		igt_fixture() {
> -			unpin_rps(sysfs);
> -			close(sysfs);
> +			i915_for_each_gt(i915, sysfs_gt, gt)
> +				unpin_rps(sysfs_gt);
> +
>  			intel_register_access_fini(&mmio);
>  		}
>  	}

  parent reply	other threads:[~2026-04-10 12:16 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-09 14:06 [PATCH i-g-t v3] tests/intel/gem_exec_endless: Use the per-gt interface to set frequencies Krzysztof Niemiec
2026-04-10  3:03 ` ✓ Xe.CI.BAT: success for tests/intel/gem_exec_endless: Use the per-gt interface to set frequencies (rev3) Patchwork
2026-04-10  3:19 ` ✓ i915.CI.BAT: " Patchwork
2026-04-10  7:15 ` ✗ Xe.CI.FULL: failure " Patchwork
2026-04-10 12:16 ` Janusz Krzysztofik [this message]
2026-04-10 22:39 ` ✗ i915.CI.Full: " Patchwork

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=80fb52072aec29387944507afc63ceda0fc72210.camel@linux.intel.com \
    --to=janusz.krzysztofik@linux.intel.com \
    --cc=andi.shyti@linux.intel.com \
    --cc=igt-dev@lists.freedesktop.org \
    --cc=krzysztof.karas@intel.com \
    --cc=krzysztof.niemiec@intel.com \
    --cc=sebastian.brzezinka@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox