Intel-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Ashutosh Dixit <ashutosh.dixit@intel.com>
To: intel-gfx@lists.freedesktop.org
Cc: dri-devel@lists.freedesktop.org
Subject: [Intel-gfx] [PATCH 1/2] drm/i915/pmu: Use only freq bits for falling back to requested freq
Date: Fri,  3 Mar 2023 17:27:04 -0800	[thread overview]
Message-ID: <20230304012705.70003-2-ashutosh.dixit@intel.com> (raw)
In-Reply-To: <20230304012705.70003-1-ashutosh.dixit@intel.com>

On newer generations, the GEN12_RPSTAT1 register contains more than freq
information, e.g. see GEN12_VOLTAGE_MASK. Therefore use only the freq bits
to decide whether to fall back to requested freq.

Signed-off-by: Ashutosh Dixit <ashutosh.dixit@intel.com>
---
 drivers/gpu/drm/i915/i915_pmu.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_pmu.c b/drivers/gpu/drm/i915/i915_pmu.c
index 52531ab28c5f..f0a1e36915b8 100644
--- a/drivers/gpu/drm/i915/i915_pmu.c
+++ b/drivers/gpu/drm/i915/i915_pmu.c
@@ -393,10 +393,8 @@ frequency_sample(struct intel_gt *gt, unsigned int period_ns)
 		 * case we assume the system is running at the intended
 		 * frequency. Fortunately, the read should rarely fail!
 		 */
-		val = intel_rps_read_rpstat_fw(rps);
-		if (val)
-			val = intel_rps_get_cagf(rps, val);
-		else
+		val = intel_rps_get_cagf(rps, intel_rps_read_rpstat_fw(rps));
+		if (!val)
 			val = rps->cur_freq;
 
 		add_sample_mult(&pmu->sample[__I915_SAMPLE_FREQ_ACT],
-- 
2.38.0


  reply	other threads:[~2023-03-04  1:27 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-04  1:27 [Intel-gfx] [PATCH 0/2] drm/i915/pmu: Freq sampling: Fix requested freq fallback Ashutosh Dixit
2023-03-04  1:27 ` Ashutosh Dixit [this message]
2023-03-06 11:04   ` [Intel-gfx] [PATCH 1/2] drm/i915/pmu: Use only freq bits for falling back to requested freq Tvrtko Ursulin
2023-03-08  5:36     ` Dixit, Ashutosh
2023-03-08 10:40       ` Tvrtko Ursulin
2023-03-04  1:27 ` [Intel-gfx] [PATCH 2/2] drm/i915/pmu: Use correct requested freq for SLPC Ashutosh Dixit
2023-03-06 11:10   ` Tvrtko Ursulin
2023-03-08  5:36     ` Dixit, Ashutosh
2023-03-08 10:52       ` Tvrtko Ursulin
2023-03-04  2:08 ` [Intel-gfx] ✓ Fi.CI.BAT: success for drm/i915/pmu: Freq sampling: Fix requested freq fallback Patchwork
2023-03-06 22:52 ` [Intel-gfx] ✓ 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=20230304012705.70003-2-ashutosh.dixit@intel.com \
    --to=ashutosh.dixit@intel.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=intel-gfx@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