mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-01-08 14:23:19 +00:00
tools/power/turbostat: Add support for new i915 sysfs knobs
On Meteorlake platform, i915 driver supports the traditional graphics sysfs knobs including /sys/class/drm/card0/power/rc6_residency_ms /sys/class/drm/card0/gt_cur_freq_mhz /sys/class/drm/card0/gt_act_freq_mhz At the same time, it also supports /sys/class/drm/card0/gt/gt0/rc6_residency_ms /sys/class/drm/card0/gt/gt0/rps_cur_freq_mhz /sys/class/drm/card0/gt/gt0/rps_act_freq_mhz /sys/class/drm/card0/gt/gt1/rc6_residency_ms /sys/class/drm/card0/gt/gt1/rps_cur_freq_mhz /sys/class/drm/card0/gt/gt1/rps_act_freq_mhz gt0 is for GFX and gt1 is for SA Media. Enhance turbostat to prefer the i915 new sysfs knobs. Export gt0 via BIC_GFX_rc6/BIC_GFXMHz/BIC_GFXACTMHz. Export gt1 via BIC_SMA_mc6/BIC_SMAMHz/BIC_SMAACTMHz. Signed-off-by: Zhang Rui <rui.zhang@intel.com>
This commit is contained in:
parent
3bbb331c1d
commit
dc02dc937a
@ -5380,6 +5380,29 @@ static void probe_intel_uncore_frequency(void)
|
||||
|
||||
static void probe_graphics(void)
|
||||
{
|
||||
/* New i915 graphics sysfs knobs */
|
||||
if (!access("/sys/class/drm/card0/gt/gt0/rc6_residency_ms", R_OK)) {
|
||||
gfx_info[GFX_rc6].path = "/sys/class/drm/card0/gt/gt0/rc6_residency_ms";
|
||||
|
||||
if (!access("/sys/class/drm/card0/gt/gt0/rps_cur_freq_mhz", R_OK))
|
||||
gfx_info[GFX_MHz].path = "/sys/class/drm/card0/gt/gt0/rps_cur_freq_mhz";
|
||||
|
||||
if (!access("/sys/class/drm/card0/gt/gt0/rps_act_freq_mhz", R_OK))
|
||||
gfx_info[GFX_ACTMHz].path = "/sys/class/drm/card0/gt/gt0/rps_act_freq_mhz";
|
||||
|
||||
if (!access("/sys/class/drm/card0/gt/gt1/rc6_residency_ms", R_OK))
|
||||
gfx_info[SAM_mc6].path = "/sys/class/drm/card0/gt/gt1/rc6_residency_ms";
|
||||
|
||||
if (!access("/sys/class/drm/card0/gt/gt1/rps_cur_freq_mhz", R_OK))
|
||||
gfx_info[SAM_MHz].path = "/sys/class/drm/card0/gt/gt1/rps_cur_freq_mhz";
|
||||
|
||||
if (!access("/sys/class/drm/card0/gt/gt1/rps_act_freq_mhz", R_OK))
|
||||
gfx_info[SAM_ACTMHz].path = "/sys/class/drm/card0/gt/gt1/rps_act_freq_mhz";
|
||||
|
||||
goto end;
|
||||
}
|
||||
|
||||
/* Fall back to traditional i915 graphics sysfs knobs */
|
||||
if (!access("/sys/class/drm/card0/power/rc6_residency_ms", R_OK))
|
||||
gfx_info[GFX_rc6].path = "/sys/class/drm/card0/power/rc6_residency_ms";
|
||||
|
||||
@ -5394,6 +5417,7 @@ static void probe_graphics(void)
|
||||
else if (!access("/sys/class/graphics/fb0/device/drm/card0/gt_act_freq_mhz", R_OK))
|
||||
gfx_info[GFX_ACTMHz].path = "/sys/class/graphics/fb0/device/drm/card0/gt_act_freq_mhz";
|
||||
|
||||
end:
|
||||
if (gfx_info[GFX_rc6].path)
|
||||
BIC_PRESENT(BIC_GFX_rc6);
|
||||
if (gfx_info[GFX_MHz].path)
|
||||
|
Loading…
Reference in New Issue
Block a user