Skip to content

Commit

Permalink
Improve OneUI detection & attempt to fix GPU clocks
Browse files Browse the repository at this point in the history
Signed-off-by: pedrozzz0 <[email protected]>
  • Loading branch information
pedrozzz0 committed May 9, 2021
1 parent e1bb768 commit af301cb
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions libktsr.sh
Original file line number Diff line number Diff line change
Expand Up @@ -221,9 +221,6 @@ SCHED_TASKS_THROUGHPUT="6"
gpumx2=$(cat $gpui/gpu_freq_table | awk 'NF>1{print $NF}')

if [[ $gpumx2 -ne $gpumxfreq ]]; then
gpumx2=$(cat $gpui/gpu_freq_table | awk '{print $1}')

elif [[ $gpumx2 -ne $gpumxfreq ]]; then
gpumx2=$gpumxfreq
fi

Expand Down Expand Up @@ -278,17 +275,17 @@ cpuminclkmhz=$((cpumnfreq / 1000))
if [[ -e "$gpu/max_gpuclk" ]]; then
gpumxfreq=$(cat $gpu/max_gpuclk)

elif [[ -e "$gpui/gpu_max_clock" ]]; then
gpumxfreq=$(cat $gpui/gpu_max_clock)
elif [[ -e "$gpu/max_clock" ]]; then
gpumxfreq=$(cat $gpu/max_clock)
fi

# Get minimum GPU frequency (gpumin also does almost the same thing)
if [[ -e "$gpu/min_clock_mhz" ]]; then
gpumnfreq=$(cat $gpu/min_clock_mhz)
gpumnfreq=$((gpumnfreq * 1000000))

elif [[ -e "$gpui/gpu_min_clock" ]]; then
gpumnfreq=$(cat $gpui/gpu_min_clock)
elif [[ -e "$gpu/min_clock" ]]; then
gpumnfreq=$(cat $gpu/min_clock)
fi

# Max & min GPU clock in MHz
Expand Down Expand Up @@ -560,7 +557,7 @@ fi
dvb=$(getprop ro.product.brand)

# Check if we're running on OneUI
if [[ $(getprop net.knoxscep.version) ]] || [[ $(getprop ro.boot.em.model) ]] || [[ $(getprop net.knoxvpn.version) ]] || [[ $(getprop ro.build.PDA) ]]; then
if [[ $(getprop net.knoxscep.version) ]] || [[ $(getprop ril.product_code) ]] || [[ $(getprop ro.boot.em.model) ]] || [[ $(getprop net.knoxvpn.version) ]] || [[ $(getprop ro.securestorage.knox) ]] || [[ $(getprop gsm.version.ril-impl | grep Samsung) ]] || [[ $(getprop ro.build.PDA) ]]; then
isosoneui=true

else
Expand Down

0 comments on commit af301cb

Please sign in to comment.