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.
This commit is contained in:
Jeremy Whiting 2024-04-30 12:52:17 -06:00 committed by Jeremy Whiting
parent c82e8df52c
commit f3e5c8b576
2 changed files with 43 additions and 22 deletions

View file

@ -445,6 +445,7 @@ mod test {
let proxy = ManualGpuClockProxy::new(&test.connection).await.unwrap();
power::test::setup().await;
assert!(proxy.manual_gpu_clock().await.is_err());
power::test::write_clocks(1600).await;