Skip to content

Commit

Permalink
Fix OD_VDDC_CURVE parsing (#17, #18)
Browse files Browse the repository at this point in the history
Looks like that /sys/class/drm/cardX/device/pp_od_clk_voltage kernel
interface that is reporting OD_VDDC_CURVE is changing format from
version to version, like before 5.5 or something it was like (note MHZ)

  0: 800MHZ, 800mV

then up to 5.8 (or 5.9?) it was like (note MHz, '@' and missing comma)

  0: 800MHz @ 800mV

and now on 5.10 (note no commas or '@')

  0: 800MHz 800mV

This plays catch up with all these variants, and now "accepts" all
formatting variants as valid, and warns about possible future ones.
  • Loading branch information
sibradzic committed Nov 1, 2020
1 parent 14ac5ef commit 5b48f04
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions amdgpu-clocks
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,16 @@ function fill_mclks() {
}

function fill_vddccurve() {
echo " VDDC Curve state $1: ${2}, ${4}"
VDDC_CURVE[${1}]="vc ${1} ${2%*M[Hh]z} ${4%*mV}"
if [ $# -eq 3 ]; then
echo " VDDC Curve state $1: ${2} ${3}"
VDDC_CURVE[${1}]="vc ${1} ${2%*M[Hh]z} ${3%*mV}"
elif [ $# -eq 4 ]; then
echo " VDDC Curve state $1: ${2} @ ${4}"
VDDC_CURVE[${1}]="vc ${1} ${2%*M[Hh]z} ${4%*mV}"
else
echo "ERROR: Can't parse '$@', did pp_od_clk_voltage API change again?"
exit 2
fi
}

function parse_states() {
Expand Down

0 comments on commit 5b48f04

Please sign in to comment.