From: Ashutosh Dixit <ashutosh.dixit@intel.com>
To: intel-gfx@lists.freedesktop.org
Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>, dri-devel@lists.freedesktop.org
Subject: [Intel-gfx] [PATCH 2/2] drm/i915/pmu: Remove fallback to requested freq for SLPC
Date: Wed, 8 Mar 2023 19:46:21 -0800 [thread overview]
Message-ID: <20230309034621.1008458-3-ashutosh.dixit@intel.com> (raw)
In-Reply-To: <20230309034621.1008458-1-ashutosh.dixit@intel.com>
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(>->uc))
val = intel_gpu_freq(rps, rps->cur_freq);
add_sample_mult(&pmu->sample[__I915_SAMPLE_FREQ_ACT],
--
2.38.0
next prev parent reply other threads:[~2023-03-09 3:46 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-03-09 3:46 [Intel-gfx] [PATCH 0/2] drm/i915/pmu: Use common freq functions with sysfs Ashutosh Dixit
2023-03-09 3:46 ` [Intel-gfx] [PATCH 1/2] drm/i915/pmu: Use functions common with sysfs to read actual freq Ashutosh Dixit
2023-03-09 9:20 ` Tvrtko Ursulin
2023-03-10 1:03 ` Dixit, Ashutosh
2023-03-09 3:46 ` Ashutosh Dixit [this message]
2023-03-09 4:03 ` [Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for drm/i915/pmu: Use common freq functions with sysfs (rev2) Patchwork
2023-03-09 4:27 ` [Intel-gfx] ✓ Fi.CI.BAT: success " Patchwork
2023-03-10 18:01 ` [Intel-gfx] ✓ Fi.CI.IGT: " Patchwork
-- strict thread matches above, loose matches on Subject: below --
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 2/2] drm/i915/pmu: Remove fallback to requested freq for SLPC Ashutosh Dixit
2023-03-15 9:50 ` Tvrtko Ursulin
2023-03-15 23:54 ` Dixit, Ashutosh
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=20230309034621.1008458-3-ashutosh.dixit@intel.com \
--to=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