Igt-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Belgaumkar, Vinay" <vinay.belgaumkar@intel.com>
To: Ashutosh Dixit <ashutosh.dixit@intel.com>,
	<igt-dev@lists.freedesktop.org>
Subject: Re: [igt-dev] [PATCH v2 i-g-t 3/4] tests/gem_ctx_freq: Disable SLPC efficient freq for the test
Date: Thu, 8 Jun 2023 10:45:28 -0700	[thread overview]
Message-ID: <044cb5a8-808f-6973-863f-a154afb5ce9d@intel.com> (raw)
In-Reply-To: <20230608154756.2866519-4-ashutosh.dixit@intel.com>


On 6/8/2023 8:47 AM, Ashutosh Dixit wrote:
> When SLPC efficient freq is enabled, GPU frequencies can be outside the
> min/max range set from sysfs. Any test which compares actual GPU frequency
> against set frequencies is therefore meaningful only when SLPC efficient
> freq is disabled.
>
> v2: Move ignore_slpc_efficient_freq to lib/igt_pm.c (Vinay)

LGTM,

Reviewed-by: Vinay Belgaumkar <vinay.belgaumkar@intel.com>

>
> Bug: https://gitlab.freedesktop.org/drm/intel/-/issues/6786
> Signed-off-by: Ashutosh Dixit <ashutosh.dixit@intel.com>
> ---
>   lib/igt_pm.c              | 17 +++++++++++++++++
>   lib/igt_pm.h              |  1 +
>   tests/i915/gem_ctx_freq.c |  6 +++++-
>   3 files changed, 23 insertions(+), 1 deletion(-)
>
> diff --git a/lib/igt_pm.c b/lib/igt_pm.c
> index e60b09a73140..18c84bf3a021 100644
> --- a/lib/igt_pm.c
> +++ b/lib/igt_pm.c
> @@ -1400,3 +1400,20 @@ int igt_pm_get_runtime_usage(struct pci_device *pci_dev)
>   
>   	return usage;
>   }
> +
> +/**
> + * igt_pm_ignore_slpc_efficient_freq
> + * @i915: open i915 drm file descriptor
> + * @gtfd: open gt sysfs fd
> + * @val: value to set
> + *
> + * Ignores/un-ignores SLPC efficient frequency
> + */
> +void igt_pm_ignore_slpc_efficient_freq(int i915, int gtfd, bool val)
> +{
> +	if (!(gem_using_guc_submission(i915) && i915_is_slpc_enabled(i915)))
> +		return;
> +
> +	igt_require(igt_sysfs_has_attr(gtfd, "slpc_ignore_eff_freq"));
> +	igt_assert(igt_sysfs_set_u32(gtfd, "slpc_ignore_eff_freq", val));
> +}
> diff --git a/lib/igt_pm.h b/lib/igt_pm.h
> index 448cf42de7f1..71ec2f239993 100644
> --- a/lib/igt_pm.h
> +++ b/lib/igt_pm.h
> @@ -88,5 +88,6 @@ bool i915_is_slpc_enabled_gt(int drm_fd, int gt);
>   bool i915_is_slpc_enabled(int drm_fd);
>   int igt_pm_get_runtime_suspended_time(struct pci_device *pci_dev);
>   int igt_pm_get_runtime_usage(struct pci_device *pci_dev);
> +void igt_pm_ignore_slpc_efficient_freq(int i915, int gtfd, bool val);
>   
>   #endif /* IGT_PM_H */
> diff --git a/tests/i915/gem_ctx_freq.c b/tests/i915/gem_ctx_freq.c
> index b2f6c2af55e1..d15f83600480 100644
> --- a/tests/i915/gem_ctx_freq.c
> +++ b/tests/i915/gem_ctx_freq.c
> @@ -147,9 +147,11 @@ static void sysfs_range(int dirfd, int gt)
>   	 * The sysfs interface sets the global limits and overrides the
>   	 * user's request. So we can to check that if the user requests
>   	 * a range outside of the sysfs, the requests are only run at the
> -	 * constriained sysfs range.
> +	 * constrained sysfs range. With GuC SLPC this requires disabling
> +	 * efficient freq.
>   	 */
>   
> +	igt_pm_ignore_slpc_efficient_freq(i915, dirfd, true);
>   	igt_require(get_sysfs_freq(dirfd, &sys_min, &sys_max));
>   	igt_info("System min freq: %dMHz; max freq: %dMHz\n", sys_min, sys_max);
>   
> @@ -199,6 +201,8 @@ static void __restore_sysfs_freq(int dirfd)
>   {
>   	char buf[256];
>   
> +	igt_pm_ignore_slpc_efficient_freq(i915, dirfd, false);
> +
>   	if (igt_sysfs_read(sysfs, "gt_RPn_freq_mhz", buf, sizeof(buf)) > 0)
>   		igt_sysfs_rps_set(dirfd, RPS_MIN_FREQ_MHZ, buf);
>   

  reply	other threads:[~2023-06-08 17:45 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-08 15:47 [igt-dev] [PATCH v2 i-g-t 0/4] gem_ctx_freq: multi-gt support and disable efficient freq Ashutosh Dixit
2023-06-08 15:47 ` [igt-dev] [PATCH i-g-t 1/4] tests/gem_ctx_freq: Add support for multi-gts Ashutosh Dixit
2023-06-08 15:47 ` [igt-dev] [PATCH i-g-t 2/4] lib/igt_sysfs: Don't assert in igt_sysfs_dir_id_to_name Ashutosh Dixit
2023-06-08 15:47 ` [igt-dev] [PATCH v2 i-g-t 3/4] tests/gem_ctx_freq: Disable SLPC efficient freq for the test Ashutosh Dixit
2023-06-08 17:45   ` Belgaumkar, Vinay [this message]
2023-06-08 15:47 ` [igt-dev] [PATCH i-g-t 4/4] HAX: Add gem_ctx_freq to BAT testlist Ashutosh Dixit
2023-06-08 16:32 ` [igt-dev] ✓ Fi.CI.BAT: success for gem_ctx_freq: multi-gt support and disable efficient freq (rev2) Patchwork
2023-06-09 19:54 ` [igt-dev] ✓ Fi.CI.IGT: " 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=044cb5a8-808f-6973-863f-a154afb5ce9d@intel.com \
    --to=vinay.belgaumkar@intel.com \
    --cc=ashutosh.dixit@intel.com \
    --cc=igt-dev@lists.freedesktop.org \
    /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