• Darren Powell's avatar
    amdgpu/pm: Create shared array of power profile name strings · 3867e370
    Darren Powell authored
    
    
     == Description ==
     All the power profile modes use the same strings (or a subset of)
     Creating a public array of the strings will allow sharing rather than
     duplicating for each chip
     First patch only implements change for navi10, followup with other chips
    
     == Changes ==
     Create a declaration of the public array in kgd_pp_interface.h
     Define the public array in amdgpu_pm.c
     Modify the implementaiton of navi10_get_power_profile_mode to use new array
    
     == Test ==
     LOGFILE=pp_profile_strings.test.log
     AMDGPU_PCI_ADDR=`lspci -nn | grep "VGA\|Display" | cut -d " " -f 1`
     AMDGPU_HWMON=`ls -la /sys/class/hwmon | grep $AMDGPU_PCI_ADDR | awk '{print $9}'`
     HWMON_DIR=/sys/class/hwmon/${AMDGPU_HWMON}
    
     lspci -nn | grep "VGA\|Display"  > $LOGFILE
     FILES="pp_power_profile_mode "
    
     for f in $FILES
     do
       echo === $f === >> $LOGFILE
       cat $HWMON_DIR/device/$f >> $LOGFILE
     done
     cat $LOGFILE
    Signed-off-by: default avatarDarren Powell <darren.powell@amd.com>
    Reviewed-by: default avatarLijo Lazar <lijo.lazar@amd.com>
    Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
    3867e370
amdgpu_pm.c 107 KB