Skip to content

Commit

Permalink
fix: collect values for rdna3 mobile power profile modes correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
ilya-zlobintsev committed Dec 19, 2024
1 parent 57bb2b1 commit 9974c78
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 220 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "amdgpu-sysfs"
version = "0.17.4"
version = "0.17.5"
authors = ["Ilya Zlobintsev <[email protected]>"]
edition = "2021"
license = "GPL-3.0"
Expand Down
26 changes: 15 additions & 11 deletions src/gpu_handle/power_profile_mode.rs
Original file line number Diff line number Diff line change
Expand Up @@ -315,18 +315,22 @@ impl PowerProfileModesTable {
for (profile_i, raw_value) in split.enumerate() {
let value = raw_value.parse()?;

let component = PowerProfileComponent {
clock_type: None,
values: vec![Some(value)],
};
let profile = modes.get_mut(&(profile_i as u16)).ok_or_else(|| {
Error::basic_parse_error("Could not get profile from header by index")
})?;

modes
.get_mut(&(profile_i as u16))
.ok_or_else(|| {
Error::basic_parse_error("Could not get profile from header by index")
})?
.components
.push(component);
match profile.components.first_mut() {
Some(component) => {
component.values.push(Some(value));
}
None => {
let component = PowerProfileComponent {
clock_type: None,
values: vec![Some(value)],
};
profile.components.push(component);
}
}
}
}

Expand Down
Loading

0 comments on commit 9974c78

Please sign in to comment.