Commit graph

44 commits

Author SHA1 Message Date
Vicki Pfau
f2cf6d87fe manager/user: Make GPU interfaces optional 2024-08-13 20:16:14 -07:00
Vicki Pfau
53754680c1 power: Make test::setup return a Result 2024-08-13 20:15:10 -07:00
Vicki Pfau
4f3a5547d6 manager/user: Move relevant methods to GpuPerformanceLevel1, update as specified 2024-08-06 19:15:40 -07:00
Vicki Pfau
fc25da30af manager/user: Move relevant methods to GpuPowerProfile1, update as specified 2024-08-06 19:15:40 -07:00
Vicki Pfau
fb58cd8772 Run cargo fmt 2024-08-02 18:12:25 -07:00
Vicki Pfau
cf9253a709 power: Query GPU clock range from pp_dpm_sclk 2024-08-02 17:22:21 -07:00
Vicki Pfau
6867c4e870 power: Remove inline GPU clock range check, sysfs writes enforce it 2024-08-02 17:21:31 -07:00
Vicki Pfau
fd6d9cbfe0 power: Simplify GPU power profiles parsing with regex 2024-08-02 17:21:29 -07:00
Vicki Pfau
4efb3572ec power: Simplify GPUPowerProfile definition with strum 2024-07-31 20:40:27 -07:00
Vicki Pfau
126f912781 power: Fix GPUPerformanceLevel enum to match amdgpu definition 2024-07-30 20:33:37 -07:00
Vicki Pfau
8412adcd4a power: Clean up CPU sysfs property reading 2024-07-24 21:20:15 -07:00
Vicki Pfau
ffcd702172 Run clang fmt 2024-07-24 21:18:19 -07:00
Vicki Pfau
3c2dd55f87 power: Add basic tests for CPUScalingGovernor getters 2024-07-24 21:17:48 -07:00
Vicki Pfau
deb8cf620f power: Add basic tests for GPUPowerProfile getters 2024-07-24 20:01:02 -07:00
Jeremy Whiting
b54cb5638a Use Strum for GPUPerformanceLevel.
Can't use it with GPUPowerProfile because one of the sysfs
strings starts with a '3' digit.
2024-06-28 22:52:41 +00:00
Vicki Pfau
336fe1d3be Run cargo fmt 2024-06-28 15:51:27 -07:00
Vicki Pfau
5e8b4160d2 power: Combine GPU prefix lookups into simpler helpers
Previously we had two diferent lookup functions for finding the GPU in
/sys/class/drm/card* and /sys/class/hwmon/hwmon*, but for the former we only
used paths under it in device/. In both these cases, the device/ directory is a
symbolic link to the same directory, so in the case of one AMD GPU in a
machine, these operations were equivalent.

This MR removes the /sys/class/drm version as well as refactoring some of the
utility code to reduce code duplication.
2024-06-28 15:11:50 -07:00
Jeremy Whiting
93e153079d Rework the CPUGovernors enum a bit.
Change to CPUScalingGovernors and use strum
crate to remove some cruft.
2024-06-28 08:59:11 -06:00
Jeremy Whiting
7f9d25074e Add CPU Scheduler Governors.
Add a new enumeration for cpu scheduler governors.
Adds a property to get the available governors as a map of
value to strings similar to how we expose GPU Power Profiles.
Adds another property to get and set the current governor which
is applied to all cpus when set.
2024-06-28 08:59:08 -06:00
Jeremy Whiting
0759ff7077 Add gpu power profile(s) properties.
Add profiles property to give back available
profiles on this device.
Add profile property to get and set current gpu
power profile.
Filter possible properties when on deck.
Get current profile based on position of * character.
Get card0 path based on which cardX has vendor 0x1002
Add some basic tests.
TODO:
Possibly cache available properties instead of fetching repeatedly.
2024-06-05 15:36:41 -06:00
Vicki Pfau
788cf884bf Run cargo fmt 2024-05-30 16:54:14 -07:00
Vicki Pfau
922ba006ae power: Improve GPU test reliability 2024-05-30 01:41:20 -07:00
Vicki Pfau
98f402c33c power: Add enum round-trip tests 2024-05-24 15:10:45 -07:00
Vicki Pfau
b7b09e6c17 power: Move GPUPerformanceLevel::to_string to Display::fmt 2024-05-22 18:57:16 -07:00
Vicki Pfau
20227416e1 power: Make GPUPerformanceLevel::from_str implementation consistent with others 2024-05-13 18:55:38 -07:00
Vicki Pfau
e25b1a7ca7 steamosctl: Use GPUPerformanceLevel where applicable 2024-05-13 18:55:38 -07:00
Jeremy Whiting
f3e5c8b576 Use hwmon to determine which sysfs path to use for gpu/power bits.
Instead of always using /sys/class/drm/card0 based paths, use
/sys/class/hwmon looking for amdgpu name file to determine where
to look.
Fixes reading TDPLimit, GPUPerformanceLevel and ManualGPUClock
in cases where sysfs uses card1 or other paths.
NOTE: Using wrong cardX path is a bug and will be fixed, but
this makes steamos-manager a bit more resilient to those bugs.
2024-05-01 21:17:45 -06:00
Vicki Pfau
fc77feef2a power: Return 0 if no GPU clock can be found 2024-05-01 19:13:03 -07:00
Vicki Pfau
a182d580fd power: Idiom fix 2024-04-16 18:44:59 -07:00
Vicki Pfau
f004035f7f power: Make sure to flush writes before dropping the files 2024-04-16 18:41:04 -07:00
Vicki Pfau
b962bbf548 Fix clippy warnings, and an actual bug with FanControl::try_from<u32> 2024-04-05 15:30:15 -07:00
Vicki Pfau
92817223d5 power: Fix get_tdp_limit not handling trailing newline 2024-04-05 15:01:31 -07:00
Vicki Pfau
cf962b26c5 Fix test build warnings 2024-04-04 18:38:39 -07:00
Vicki Pfau
cf4d7b9ba9 manager: Add manual_gpu_clock tests 2024-04-04 18:08:21 -07:00
Vicki Pfau
bc6af282eb power: Add get/set_gpu_clocks and get_tdp_limit tests 2024-04-04 18:08:21 -07:00
Vicki Pfau
3c62c57d52 manager: Add get/set_gpu_performance_level tests 2024-04-04 18:08:21 -07:00
Vicki Pfau
9ddbc9997d power: Add get/set_gpu_performance_level tests 2024-04-04 18:08:21 -07:00
Vicki Pfau
eabf6d5a98 power: Implement get_tdp_limit and TDPLimit 2024-04-04 18:08:21 -07:00
Vicki Pfau
d13010dcb0 power: Implement get_gpu_clocks and ManualGPUClock 2024-04-04 18:08:21 -07:00
Vicki Pfau
35e520712d Realign enums that had UnsupportedFeature to start at 0 2024-04-04 18:08:21 -07:00
Vicki Pfau
452690adee Kill UnsupportedFeature 2024-04-04 18:08:21 -07:00
Vicki Pfau
69e6477053 manager: Implement new API 2024-04-04 18:08:13 -07:00
Vicki Pfau
27493c647d power: Redo hwmon handling 2024-04-02 18:20:09 -07:00
Vicki Pfau
6e3ac42e8e power: Split out from manager 2024-04-02 18:20:09 -07:00