[PATCH 2/2] drm/i915/pmu: Use correct requested freq for SLPC

Ashutosh Dixit ashutosh.dixit at intel.com
Sat Mar 4 01:27:05 UTC 2023


SLPC does not use 'struct intel_rps'. Use UNSLICE_RATIO bits from
GEN6_RPNSWREQ for SLPC. See intel_rps_get_requested_frequency.

Bspec: 52745

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

diff --git a/drivers/gpu/drm/i915/i915_pmu.c b/drivers/gpu/drm/i915/i915_pmu.c
index f0a1e36915b8..5ee836610801 100644
--- a/drivers/gpu/drm/i915/i915_pmu.c
+++ b/drivers/gpu/drm/i915/i915_pmu.c
@@ -394,8 +394,13 @@ frequency_sample(struct intel_gt *gt, unsigned int period_ns)
 		 * frequency. Fortunately, the read should rarely fail!
 		 */
 		val = intel_rps_get_cagf(rps, intel_rps_read_rpstat_fw(rps));
-		if (!val)
-			val = rps->cur_freq;
+		if (!val) {
+			if (intel_uc_uses_guc_slpc(&gt->uc))
+				val = intel_rps_read_punit_req(rps) >>
+						GEN9_SW_REQ_UNSLICE_RATIO_SHIFT;
+			else
+				val = rps->cur_freq;
+		}
 
 		add_sample_mult(&pmu->sample[__I915_SAMPLE_FREQ_ACT],
 				intel_gpu_freq(rps, val), period_ns / 1000);
-- 
2.38.0



More information about the dri-devel mailing list