public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
From: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
To: Ashutosh Dixit <ashutosh.dixit@intel.com>,
	intel-gfx@lists.freedesktop.org
Cc: dri-devel@lists.freedesktop.org, Rodrigo Vivi <rodrigo.vivi@intel.com>
Subject: Re: [Intel-gfx] [PATCH 2/2] drm/i915/pmu: Remove fallback to requested freq for SLPC
Date: Wed, 15 Mar 2023 09:50:17 +0000	[thread overview]
Message-ID: <f1334ee6-2fb8-3306-2344-0c93b76a886e@linux.intel.com> (raw)
In-Reply-To: <20230310005943.1029333-3-ashutosh.dixit@intel.com>


On 10/03/2023 00:59, Ashutosh Dixit wrote:
> The fallback to requested freq does not work for SLPC because SLPC does not
> use 'struct intel_rps'. Also for SLPC requested freq can only be obtained
> from a hw register after acquiring forcewake which we don't want to do for
> PMU. Therefore remove fallback to requested freq for SLPC. The actual freq
> will be 0 when gt is in RC6 which is correct. Also this is rare since PMU
> freq sampling happens only when gt is unparked.
> 
> Signed-off-by: Ashutosh Dixit <ashutosh.dixit@intel.com>
> ---
>   drivers/gpu/drm/i915/i915_pmu.c | 9 ++++++++-
>   1 file changed, 8 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/i915/i915_pmu.c b/drivers/gpu/drm/i915/i915_pmu.c
> index 7ece883a7d95..f697fabed64a 100644
> --- a/drivers/gpu/drm/i915/i915_pmu.c
> +++ b/drivers/gpu/drm/i915/i915_pmu.c
> @@ -393,7 +393,14 @@ frequency_sample(struct intel_gt *gt, unsigned int period_ns)
>   		 * frequency. Fortunately, the read should rarely fail!
>   		 */
>   		val = intel_rps_read_actual_frequency_fw(rps);
> -		if (!val)
> +
> +		/*
> +		 * SLPC does not use 'struct intel_rps'. Also for SLPC
> +		 * requested freq can only be obtained after acquiring
> +		 * forcewake and reading a hw register. For SLPC just
> +		 * let val be 0
> +		 */
> +		if (!val && !intel_uc_uses_guc_slpc(&gt->uc))
>   			val = intel_gpu_freq(rps, rps->cur_freq);

I really dislike sprinkling of "uses slpc" since I think the thing 
hasn't really been integrated nicely. Case in point is probably the flow 
duality in intel_rps_boost. Data structures as well, even though some 
fields and concepts are shared.

For instance why we can't have the notion of software tracked cur_freq 
in rps, and/or have it zero if with SLPC we can't have it otherwise?

I will abstain, sorry.

Regards,

Tvrtko

>   
>   		add_sample_mult(&pmu->sample[__I915_SAMPLE_FREQ_ACT],

  reply	other threads:[~2023-03-15  9:50 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-10  0:59 [Intel-gfx] [PATCH 0/2] drm/i915/pmu: Use common freq functions with sysfs Ashutosh Dixit
2023-03-10  0:59 ` [Intel-gfx] [PATCH 1/2] drm/i915/pmu: Use functions common with sysfs to read actual freq Ashutosh Dixit
2023-03-15  9:43   ` Tvrtko Ursulin
2023-03-16  0:53     ` Dixit, Ashutosh
2023-03-10  0:59 ` [Intel-gfx] [PATCH 2/2] drm/i915/pmu: Remove fallback to requested freq for SLPC Ashutosh Dixit
2023-03-15  9:50   ` Tvrtko Ursulin [this message]
2023-03-15 23:54     ` Dixit, Ashutosh
2023-03-10  2:57 ` [Intel-gfx] ✓ Fi.CI.BAT: success for drm/i915/pmu: Use common freq functions with sysfs Patchwork
2023-03-12  9:27 ` [Intel-gfx] ✓ Fi.CI.IGT: " Patchwork
  -- strict thread matches above, loose matches on Subject: below --
2023-03-09  3:46 [Intel-gfx] [PATCH 0/2] " Ashutosh Dixit
2023-03-09  3:46 ` [Intel-gfx] [PATCH 2/2] drm/i915/pmu: Remove fallback to requested freq for SLPC Ashutosh Dixit

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=f1334ee6-2fb8-3306-2344-0c93b76a886e@linux.intel.com \
    --to=tvrtko.ursulin@linux.intel.com \
    --cc=ashutosh.dixit@intel.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=rodrigo.vivi@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