gpu [linux]: Add clock speed

This commit is contained in:
Dylan Araps 2017-12-23 22:25:13 +11:00
parent 8e29cd00b3
commit 0e59d6c041

View file

@ -1225,7 +1225,6 @@ get_gpu() {
[[ "$gpu_type" == "integrated" && ! "$gpu" =~ (i|I)ntel ]] && \
{ unset -v gpu; continue; }
freq="$(< /sys/devices/pci0000\:00/0000\:"${gpu/ *}"/drm/card0/gt_cur_freq_mhz)"
case "$gpu" in
*"advanced"*)
@ -1246,6 +1245,8 @@ get_gpu() {
;;
*"intel"*)
freq="$(< /sys/devices/pci0000:00/0000:"${gpu/ *}"/drm/card0/gt_cur_freq_mhz)"
type -p glxinfo >/dev/null && \
gpu="$(glxinfo | grep "Device:.*Intel")"
@ -1270,7 +1271,7 @@ get_gpu() {
prin "${subtitle:+${subtitle}${gpu_name}}" "$gpu"
[[ "$gpu_freq" == "on" && "$freq" ]] && \
[[ "${gpu_freq:-on}" == "on" && "$freq" ]] && \
prin "GPU Frequency" "${freq}Mhz"
((++gpu_num))