Skip to content

Commit

Permalink
DEV 21.01.03
Browse files Browse the repository at this point in the history
1. 修复MTK平台机型识别错误
2. 修复Binder任务放置引起的动画掉帧

Signed-off-by: Matt Yang <yccy@outlook.com>
  • Loading branch information
yc9559 committed Jan 3, 2021
1 parent 818443c commit f9a1ba8
Show file tree
Hide file tree
Showing 9 changed files with 70 additions and 34 deletions.
4 changes: 2 additions & 2 deletions magisk/module.prop
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
id=uperf
name=Uperf
version=v2 (20210102)
versionCode=1
version=v2 (21.01.03)
versionCode=2
author=Matt Yang
description=Userspace performance controller for android. Repo: https://github.com/yc9559/uperf/
minMagisk=17000
22 changes: 21 additions & 1 deletion magisk/script/libpowercfg.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# Powercfg Library
# https://github.com/yc9559/
# Author: Matt Yang
# Version: 20200330
# Version: 20210103

BASEDIR="$(dirname "$0")"
. $BASEDIR/pathinfo.sh
Expand Down Expand Up @@ -146,15 +146,35 @@ perfhal_mode="balance"
perfhal_stop()
{
stop perf-hal-1-0
stop perf-hal-1-1
stop perf-hal-1-2
stop perf-hal-1-3
stop perf-hal-2-0
stop perf-hal-2-1
stop perf-hal-2-2
stop perf-hal-2-3
stop perf-hal-3-0
stop perf-hal-3-1
stop perf-hal-3-2
stop perf-hal-3-3
usleep 500
}

# start after updating cfg
perfhal_start()
{
start perf-hal-1-0
start perf-hal-1-1
start perf-hal-1-2
start perf-hal-1-3
start perf-hal-2-0
start perf-hal-2-1
start perf-hal-2-2
start perf-hal-2-3
start perf-hal-3-0
start perf-hal-3-1
start perf-hal-3-2
start perf-hal-3-3
}

# $1:mode(such as balance)
Expand Down
2 changes: 1 addition & 1 deletion magisk/script/powercfg_main.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ save_panel()
write_panel ""
write_panel "Uperf https://github.com/yc9559/uperf/"
write_panel "Author: Matt Yang"
write_panel "Version: v2 (20210102)"
write_panel "Version: v2 (21.01.03)"
write_panel "Last performed: $(date '+%Y-%m-%d %H:%M:%S')"
write_panel ""
write_panel "[Uperf status]"
Expand Down
34 changes: 18 additions & 16 deletions magisk/script/powercfg_once.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ unify_cgroup()
mutate "1" /dev/stune/rt/schedtune.prefer_idle

mutate "0-2,6" /dev/cpuset/foreground/cpus
mutate "0-2" /dev/cpuset/background/cpus
mutate "0-3" /dev/cpuset/background/cpus

# fix laggy bilibili feed scrolling
change_task_cgroup "servicemanager" "top-app" "cpuset"
Expand All @@ -46,26 +46,28 @@ unify_cgroup()
unpin_proc "\.hardware\.camera\.provider"
unpin_proc "\.hardware\.display\."

# pin system_server in foreground to save bandwidth for UI
change_task_cgroup "system_server" "foreground" "cpuset"
# ...but exclude Binders
# pin system_server in background to save bandwidth for UI
change_task_cgroup "system_server" "background" "cpuset"
change_task_cgroup "system_server" "top-app" "stune"
# ...but exclude Binders and animations
unpin_thread "system_server" "Binder"
unpin_thread "system_server" "android\.anim"
unpin_thread "system_server" "android\.ui"
pin_thread_on_perf "system_server" "Binder"
pin_thread_on_perf "system_server" "android\.anim"
pin_thread_on_perf "system_server" "android\.ui"
# ...set UX pipeline related thread to RT policy
change_thread_rt "system_server" "input" "3"
change_thread_rt "system_server" "android\.anim" "2"
change_thread_rt "system_server" "android\.ui" "2"
# ...and pin hardware related on LITTLE
pin_thread_on_pwr "system_server" "sensor"
pin_thread_on_pwr "system_server" "wifi"
pin_thread_on_pwr "system_server" "network"
pin_thread_on_pwr "system_server" "input"
pin_thread_on_pwr "system_server" "power"
pin_thread_on_pwr "system_server" "android\.io"
pin_thread_on_pwr "system_server" "\.bg"
change_thread_rt "system_server" "input" "1"

# apply prefer idle to systemui
change_task_cgroup "com.android.systemui" "top-app" "stune"

# boost app boot process, zygote--com.xxxx.xxx
unpin_proc "zygote"
pin_proc_on_perf "zygote"

# let binders of surfaceflinger run with top-app
pin_proc_on_pwr "surfaceflinger"
change_thread_rt "surfaceflinger" "surfaceflinger" "4"
unpin_thread "surfaceflinger" "Binder"
}

Expand Down
34 changes: 28 additions & 6 deletions magisk/setup_uperf.sh
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,6 @@ _get_sdm660_type()
else
echo "$(_get_sdm636_type)"
fi

}

_get_sdm626_type()
Expand Down Expand Up @@ -248,6 +247,28 @@ _get_e8895_type()
fi
}

_get_mt6873_type()
{
local b_max
b_max="$(_get_maxfreq 4)"
if [ "$b_max" -gt 2500000 ]; then
echo "mt6875"
else
echo "mt6873"
fi
}

_get_mt6885_type()
{
local b_max
b_max="$(_get_maxfreq 4)"
if [ "$b_max" -gt 2500000 ]; then
echo "mt6889"
else
echo "mt6885"
fi
}

# $1:cfg_name
_setup_platform_file()
{
Expand Down Expand Up @@ -289,10 +310,11 @@ _get_cfgname()
"universal8895") ret="$(_get_e8895_type)" ;;
"universal8890") ret="e8890" ;;
"universal7420") ret="e7420" ;;
"mt6873") ret="mt6873" ;;
"mt6875") ret="mt6875" ;;
"mt6885") ret="mt6885" ;;
"mt6889") ret="mt6889" ;;
"mt6785") ret="mt6785" ;;
"mt6873") ret="$(_get_mt6873_type)" ;;
"mt6875") ret="$(_get_mt6873_type)" ;;
"mt6885") ret="$(_get_mt6885_type)" ;;
"mt6889") ret="$(_get_mt6885_type)" ;;
*) ret="unsupported" ;;
esac
echo "$ret"
Expand All @@ -303,7 +325,7 @@ uperf_print_banner()
echo ""
echo "* Uperf https://github.com/yc9559/uperf/"
echo "* Author: Matt Yang"
echo "* Version: v2 (20210102)"
echo "* Version: v2 (21.01.03)"
echo ""
}

Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

0 comments on commit f9a1ba8

Please sign in to comment.