Skip to content

Commit

Permalink
855/865 严格模式适配和平精英
Browse files Browse the repository at this point in the history
  • Loading branch information
helloklf committed Aug 21, 2021
1 parent 395b3e9 commit f4c1394
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 18 deletions.
15 changes: 6 additions & 9 deletions app/src/main/assets/powercfg/kona/powercfg-utils.sh
Original file line number Diff line number Diff line change
Expand Up @@ -373,32 +373,32 @@ set_task_affinity() {

# HePingJingYing
pubgmhd_opt_run () {
if [[ $(getprop vtools.powercfg_app | grep miHoYo) == "" ]]; then
if [[ $(getprop vtools.powercfg_app | grep com.tencent.tmgp.pubgmhd) == "" ]]; then
return
fi

pid=$(pgrep -f com.tencent.tmgp.pubgmhd | head -1)
# mask=`echo "obase=16;$((num=2#11110000))" | bc` # F0 (cpu 7-4)
# mask=`echo "obase=16;$((num=2#10000000))" | bc` # 80 (cpu 7)
# mask=`echo "obase=16;$((num=2#01110000))" | bc` # 70 (cpu 6-4)
# mask=`echo "obase=16;$((num=2#01111111))" | bc` # 7F (cpu 6-0)

if [[ "$pid" != "" ]]; then
ps -ef -o PID,NAME | grep -e "com.tencent.tmgp.pubgmhd$" | cut -f1 -d ' ' | while read pid; do
for tid in $(ls "/proc/$pid/task/"); do
if [[ -f "/proc/$pid/task/$tid/comm" ]]; then
comm=$(cat /proc/$pid/task/$tid/comm)

case "$comm" in
"RenderThread"*)
taskset -p "80" "$tid" 2>&1 > /dev/null
echo 1
;;
*)
taskset -p "7F" "$tid" 2>&1 > /dev/null
;;
esac
fi
done
fi
done
}

# YuanShen
Expand Down Expand Up @@ -522,11 +522,8 @@ adjustment_by_top_app() {
;;

"com.tencent.tmgp.pubgmhd")
manufacturer=$(getprop ro.product.manufacturer)
if [[ "$manufacturer" == "Xiaomi" ]]; then
cpuset '0-1' '0-3' '0-7' '0-7'
watch_app pubgmhd_opt_run &
fi
cpuset '0-1' '0-3' '0-7' '0-7'
watch_app pubgmhd_opt_run &
set_hispeed_freq 0 0 0
;;

Expand Down
15 changes: 6 additions & 9 deletions app/src/main/assets/powercfg/msmnile/powercfg-utils.sh
Original file line number Diff line number Diff line change
Expand Up @@ -411,32 +411,32 @@ set_task_affinity() {

# HePingJingYing
pubgmhd_opt_run () {
if [[ $(getprop vtools.powercfg_app | grep miHoYo) == "" ]]; then
if [[ $(getprop vtools.powercfg_app | grep com.tencent.tmgp.pubgmhd) == "" ]]; then
return
fi

pid=$(pgrep -f com.tencent.tmgp.pubgmhd | head -1)
# mask=`echo "obase=16;$((num=2#11110000))" | bc` # F0 (cpu 7-4)
# mask=`echo "obase=16;$((num=2#10000000))" | bc` # 80 (cpu 7)
# mask=`echo "obase=16;$((num=2#01110000))" | bc` # 70 (cpu 6-4)
# mask=`echo "obase=16;$((num=2#01111111))" | bc` # 7F (cpu 6-0)

if [[ "$pid" != "" ]]; then
ps -ef -o PID,NAME | grep -e "com.tencent.tmgp.pubgmhd$" | cut -f1 -d ' ' | while read pid; do
for tid in $(ls "/proc/$pid/task/"); do
if [[ -f "/proc/$pid/task/$tid/comm" ]]; then
comm=$(cat /proc/$pid/task/$tid/comm)

case "$comm" in
"RenderThread"*)
taskset -p "80" "$tid" 2>&1 > /dev/null
echo 1
;;
*)
taskset -p "7F" "$tid" 2>&1 > /dev/null
;;
esac
fi
done
fi
done
}

# YuanShen
Expand Down Expand Up @@ -560,11 +560,8 @@ adjustment_by_top_app() {
;;

"com.tencent.tmgp.pubgmhd")
manufacturer=$(getprop ro.product.manufacturer)
if [[ "$manufacturer" == "Xiaomi" ]]; then
cpuset '0-1' '0-3' '0-7' '0-7'
watch_app pubgmhd_opt_run &
fi
cpuset '0-1' '0-3' '0-7' '0-7'
watch_app pubgmhd_opt_run &
set_hispeed_freq 0 0 0
;;

Expand Down

0 comments on commit f4c1394

Please sign in to comment.