JoeSchubert/kernel_adiutor

GPU voltage control

spezi77 opened this issue · 5 comments

This feature is currently only supported by Synapse. Would be nice to have it in KA-mod as well.

see:
https://github.com/apbaxel/UKM/blob/UKM-Enhanced/data/UKM/config.json.generate.gpu

Looks like the only part of that which is pertinent is:

            `if [ -f "/sys/devices/system/cpu/cpu0/cpufreq/gpu_mv_table" ]; then
                $BB echo '{ SPane:{
                    title:"GPU Voltages"
                }},'
                    while read UVOLT UNIT; do
                    VOLTAGE=$(($VOLTAGE+1));
                        $BB echo '{ SSeekBar:{
                            default:'$UVOLT',
                            title:"Voltage '${VOLTAGE}'",
                            action:"voltage gpuvolt '${VOLTAGE}'",
                            unit:"' ${UNIT}'",'
                            if [ "$UVOLT" -ge "900000" ]; then
                                $BB echo 'min:900000, max:1200000, step:5000 }},'
                            else
                                $BB echo 'min:900, max:1200, step:5 }},'
                            fi;
                    done < /sys/devices/system/cpu/cpu0/cpufreq/gpu_mv_table
            fi`

I'll see if I can't add it. Though, I'm not entirely sure exactly how I'm going to get it going reliably for all devices.

Also, I don't even know of any kernels that actually use this... and I'd also need an example of the sysfs node that this references.

Sorry for my late reply. I can provide an example of the sysfs node until the weekend. I have merged 'GPU voltage control' into my 'Revival kernel' for mako. ;)

Basically it is a nice addition for Snapdragon/adreno based devices with custom kernel. There are a few custom kernels out there with this feature, but I can't remember exactly which ones.

No worries. If you can provide the examples, I'll try to add it.

When I make an ouput of the sysfs node I get a vector with these defaults:
shell@:/ $ cat /sys/devices/system/cpu/cpu0/cpufreq/gpu_mv_table
945 mV
1050 mV
1150 mV

Do you need the max and min values, as well? I need to look into the source code to figure out..

Here we go. I couldn't find where they define the steps. So I assume that it can be defined as we need it (e.g.: 5mV).

#define GPU_MIN_VDD 900
#define GPU_MAX_VDD 1200

spezi77/hellspawn-N4@cb1e9e4