Skip to content

Commit

Permalink
DEV 20200505
Browse files Browse the repository at this point in the history
sfanalysis:修复hook类成员函数没有传入this指针
uperf:sfanalysis也能重新拉起之前因为渲染停止提前结束的hint
uperf:uxaffinity加上循环次数保护
wipe-v2:三星HMP参数改进待机时小核频率过高
配置文件生成器:修复HMP平台和移植的EAS平台的频率上下限重合导致频率无法固定在预期
配置文件生成器:降低卡顿模式性能释放
once:屏蔽硬件相关进程的cgroup限制
自启动脚本:开机自启延迟60秒,留给用户禁用本模块的时间
自启动脚本:powerhint.json默认不覆盖,避免post-fs-data没执行还是卡开机

Signed-off-by: Matt Yang <[email protected]>
  • Loading branch information
yc9559 committed May 5, 2020
1 parent 1952c17 commit 8a6d349
Show file tree
Hide file tree
Showing 10 changed files with 134 additions and 25 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ Userspace performance controller for android

[@AndroidDumps](https://github.com/AndroidDumps)
[@shunix](https://github.com/shunix)
@YMJ
@HEX_Stan(coolapk)
@僞裝灬(coolapk)
@Yoooooo(coolapk)
Expand All @@ -31,3 +32,4 @@ Userspace performance controller for android
@asto18089(coolapk)
@顺其自然的肥肉(coolapk)
@酷斗吧(coolapk)
@何为永恒(coolapk)
4 changes: 3 additions & 1 deletion magisk/common/post-fs-data.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
MODDIR=${0%/*}

# do not place empty powerhint.json if it doesn't exist in system
[ ! -f /vendor/etc/powerhint.json ] && rm $MODDIR/system/vendor/etc/powerhint.json
if [ -f /vendor/etc/powerhint.json ]; then
cp $MODDIR/system/vendor/etc/powerhint.json.override $MODDIR/system/vendor/etc/powerhint.json
fi
2 changes: 1 addition & 1 deletion magisk/initsvc_uperf.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,5 @@ wait_until_login()
}

wait_until_login
sleep 5
sleep 60
sh $BASEDIR/run_uperf.sh
2 changes: 1 addition & 1 deletion magisk/module.prop
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
id=uperf
name=Uperf
version=DEV 20200503
version=DEV 20200505
versionCode=1
author=Matt Yang
description=Userspace performance controller for android. Repo: https://github.com/yc9559/uperf/
Expand Down
2 changes: 1 addition & 1 deletion magisk/script/libcommon.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# Basic Tool Library
# https://github.com/yc9559/
# Author: Matt Yang
# Version: 20200503
# Version: 20200505

BASEDIR="$(dirname "$0")"
. $BASEDIR/pathinfo.sh
Expand Down
6 changes: 3 additions & 3 deletions magisk/script/libsfanalysis.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# Surfaceflinger Analysis Library
# https://github.com/yc9559/
# Author: Matt Yang
# Version: 20200503
# Version: 20200505

BASEDIR="$(dirname "$0")"
. $BASEDIR/pathinfo.sh
Expand Down Expand Up @@ -36,8 +36,8 @@ sfa_start()

# fallback to standlone mode
if [ ! -f "$lib_path" ]; then
lib_path="$BASEDIR/$lib_path"
setenforce 0
lib_path="$MODULE_PATH/$lib_path"
# setenforce 0
fi

echo "$(date '+%Y-%m-%d %H:%M:%S')" > /cache/injector.log
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: DEV 20200503"
write_panel "Version: DEV 20200505"
write_panel "Last performed: $(date '+%Y-%m-%d %H:%M:%S')"
write_panel ""
write_panel "[Uperf status]"
Expand Down
28 changes: 14 additions & 14 deletions magisk/script/powercfg_once.sh
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,10 @@ lock_val "0" $KSGL/force_bus_on
lock_val "0" $KSGL/force_clk_on
lock_val "0" $KSGL/force_rail_on

# cleanup top-app cpuset
for p in $(cat /dev/cpuset/top-app/tasks); do
echo "$p" > /dev/cpuset/foreground/tasks
done
# # cleanup top-app cpuset
# for p in $(cat /dev/cpuset/top-app/tasks); do
# echo "$p" > /dev/cpuset/foreground/tasks
# done

# treat crtc_commit as background, avoid display preemption on big
change_task_cgroup "crtc_commit" "background" "cpuset"
Expand All @@ -71,16 +71,16 @@ change_thread_cgroup "system_server" "android.ui" "top-app" "stune"
# ...and pin HeapTaskDaemon on LITTLE
change_thread_cgroup "system_server" "HeapTaskDaemon" "background" "cpuset"

# reduce big cluster wakeup, eg. [email protected]
change_task_cgroup ".hardware." "background" "cpuset"
change_task_affinity ".hardware." "0f"
# ...but exclude fingerprint&camera&display service for speed
change_task_cgroup ".hardware.biometrics.fingerprint" "" "cpuset"
change_task_cgroup ".hardware.camera.provider" "" "cpuset"
change_task_cgroup ".hardware.display" "" "cpuset"
change_task_affinity ".hardware.biometrics.fingerprint" "ff"
change_task_affinity ".hardware.camera.provider" "ff"
change_task_affinity ".hardware.display" "ff"
# # reduce big cluster wakeup, eg. [email protected]
# change_task_cgroup ".hardware." "background" "cpuset"
# change_task_affinity ".hardware." "0f"
# # ...but exclude fingerprint&camera&display service for speed
# change_task_cgroup ".hardware.biometrics.fingerprint" "" "cpuset"
# change_task_cgroup ".hardware.camera.provider" "" "cpuset"
# change_task_cgroup ".hardware.display" "" "cpuset"
# change_task_affinity ".hardware.biometrics.fingerprint" "ff"
# change_task_affinity ".hardware.camera.provider" "ff"
# change_task_affinity ".hardware.display" "ff"

# provide best performance for fingerprint service
change_task_cgroup ".hardware.biometrics.fingerprint" "rt" "stune"
Expand Down
6 changes: 3 additions & 3 deletions magisk/setup_uperf.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# Uperf Setup
# https://github.com/yc9559/
# Author: Matt Yang & cjybyjk ([email protected])
# Version: 20200503
# Version: 20200505

BASEDIR="$(dirname $(readlink -f "$0"))"

Expand Down Expand Up @@ -290,7 +290,7 @@ uperf_print_banner()
echo ""
echo "* Uperf https://github.com/yc9559/uperf/"
echo "* Author: Matt Yang"
echo "* Version: DEV 20200503"
echo "* Version: DEV 20200505"
echo ""
}

Expand Down Expand Up @@ -344,7 +344,7 @@ sfa_install()

powerhal_stub_install()
{
_set_perm "$BASEDIR/system/vendor/etc/powerhint.json" 0 0 0755 u:object_r:vendor_configs_file:s0
_set_perm "$BASEDIR/system/vendor/etc/powerhint.json.override" 0 0 0755 u:object_r:vendor_configs_file:s0
}

uperf_print_banner
Expand Down
105 changes: 105 additions & 0 deletions magisk/system/vendor/etc/powerhint.json.override
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
{
"Nodes": [
{
"Name": "PMQoSCpuDmaLatency",
"Path": "/dev/cpu_dma_latency",
"Values": [
"44",
"1000"
],
"HoldFd": true
}
],
"Actions": [
{
"PowerHint": "SUSTAINED_PERFORMANCE",
"Node": "PMQoSCpuDmaLatency",
"Duration": 0,
"Value": "1000"
},
{
"PowerHint": "INTERACTION",
"Node": "PMQoSCpuDmaLatency",
"Duration": 0,
"Value": "1000"
},
{
"PowerHint": "LAUNCH",
"Node": "PMQoSCpuDmaLatency",
"Duration": 0,
"Value": "1000"
},
{
"PowerHint": "CAMERA_LAUNCH",
"Node": "PMQoSCpuDmaLatency",
"Duration": 0,
"Value": "1000"
},
{
"PowerHint": "CAMERA_STREAMING",
"Node": "PMQoSCpuDmaLatency",
"Duration": 0,
"Value": "1000"
},
{
"PowerHint": "CAMERA_STREAMING_60FPS",
"Node": "PMQoSCpuDmaLatency",
"Duration": 0,
"Value": "1000"
},
{
"PowerHint": "CAMERA_STREAMING_4K",
"Node": "PMQoSCpuDmaLatency",
"Duration": 0,
"Value": "1000"
},
{
"PowerHint": "CAMERA_STREAMING_SECURE",
"Node": "PMQoSCpuDmaLatency",
"Duration": 0,
"Value": "1000"
},
{
"PowerHint": "CAMERA_SHOT",
"Node": "PMQoSCpuDmaLatency",
"Duration": 0,
"Value": "1000"
},
{
"PowerHint": "AUDIO_STREAMING",
"Node": "PMQoSCpuDmaLatency",
"Duration": 0,
"Value": "1000"
},
{
"PowerHint": "AUDIO_LOW_LATENCY",
"Node": "PowerHALAudioState",
"Duration": 0,
"Value": "AUDIO_LOW_LATENCY"
},
{
"PowerHint": "AUDIO_LOW_LATENCY",
"Node": "PMQoSCpuDmaLatency",
"Duration": 0,
"Value": "1000"
},
{
"PowerHint": "EXPENSIVE_RENDERING",
"Node": "PowerHALRenderingState",
"Duration": 0,
"Value": "EXPENSIVE_RENDERING"
},
{
"PowerHint": "EXPENSIVE_RENDERING",
"Node": "PMQoSCpuDmaLatency",
"Duration": 0,
"Value": "1000"
},
{
"PowerHint": "TPU_BOOST",
"Node": "PMQoSCpuDmaLatency",
"Duration": 2000,
"Value": "44"
}
]
}

0 comments on commit 8a6d349

Please sign in to comment.