drm/i915/pmu: Use functions common with sysfs to read actual freq
authorAshutosh Dixit <ashutosh.dixit@intel.com>
Thu, 16 Mar 2023 00:48:00 +0000 (17:48 -0700)
committerTvrtko Ursulin <tvrtko.ursulin@intel.com>
Tue, 21 Mar 2023 08:40:49 +0000 (08:40 +0000)
commit44df42e66139b5fac8db49ee354be279210f9816
tree056a12637c0fcfbfa6cb2ca3088fbf114f241ac9
parent5e008ba67cb80084e99b40ccd46f9029ae421632
drm/i915/pmu: Use functions common with sysfs to read actual freq

Expose intel_rps_read_actual_frequency_fw to read the actual freq without
taking forcewake for use by PMU. The code is refactored to use a common set
of functions across sysfs and PMU. Using common functions with sysfs in PMU
solves the issues of missing support for MTL and missing support for older
generations (prior to Gen6). It also future proofs the PMU where sometimes
code has been updated for sysfs and PMU has been missed.

v2: Remove runtime_pm_if_in_use from read_actual_frequency_fw (Tvrtko)

v3: (Tvrtko)
 - Remove goto in __read_cagf
 - Unexport intel_rps_get_cagf and intel_rps_read_punit_req

Fixes: 22009b6dad66 ("drm/i915/mtl: Modify CAGF functions for MTL")
Link: https://gitlab.freedesktop.org/drm/intel/-/issues/8280
Signed-off-by: Ashutosh Dixit <ashutosh.dixit@intel.com>
Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20230316004800.2539753-1-ashutosh.dixit@intel.com
drivers/gpu/drm/i915/gt/intel_rps.c
drivers/gpu/drm/i915/gt/intel_rps.h
drivers/gpu/drm/i915/i915_pmu.c