Merge changes from topic "kernel5_revision" into main
* changes: bcl: correct ocp threshold bcl: support thismeal binary
This commit is contained in:
commit
5ba25e00d7
4 changed files with 26 additions and 0 deletions
|
@ -977,6 +977,9 @@ on property:vendor.thermal.link_ready=1
|
||||||
write /sys/devices/virtual/pmic/mitigation/triggered_lvl/soft_ocp_cpu2_lvl 12000
|
write /sys/devices/virtual/pmic/mitigation/triggered_lvl/soft_ocp_cpu2_lvl 12000
|
||||||
write /sys/devices/virtual/pmic/mitigation/triggered_lvl/soft_ocp_gpu_lvl 9000
|
write /sys/devices/virtual/pmic/mitigation/triggered_lvl/soft_ocp_gpu_lvl 9000
|
||||||
write /sys/devices/virtual/pmic/mitigation/triggered_lvl/soft_ocp_tpu_lvl 8500
|
write /sys/devices/virtual/pmic/mitigation/triggered_lvl/soft_ocp_tpu_lvl 8500
|
||||||
|
write /sys/devices/virtual/pmic/mitigation/triggered_lvl/ocp_cpu2_lvl 12000
|
||||||
|
write /sys/devices/virtual/pmic/mitigation/triggered_lvl/ocp_gpu_lvl 12000
|
||||||
|
write /sys/devices/virtual/pmic/mitigation/triggered_lvl/ocp_tpu_lvl 12000
|
||||||
write /sys/devices/virtual/pmic/mitigation/clock_div/tpu_clk_div 0x1
|
write /sys/devices/virtual/pmic/mitigation/clock_div/tpu_clk_div 0x1
|
||||||
write /sys/devices/virtual/pmic/mitigation/clock_div/gpu_clk_div 0x1
|
write /sys/devices/virtual/pmic/mitigation/clock_div/gpu_clk_div 0x1
|
||||||
write /sys/devices/virtual/pmic/mitigation/clock_div/cpu2_clk_div 0x1
|
write /sys/devices/virtual/pmic/mitigation/clock_div/cpu2_clk_div 0x1
|
||||||
|
|
|
@ -24,6 +24,7 @@ cc_binary {
|
||||||
],
|
],
|
||||||
vendor: true,
|
vendor: true,
|
||||||
relative_install_path: "dump",
|
relative_install_path: "dump",
|
||||||
|
init_rc: ["dump_power.rc"],
|
||||||
}
|
}
|
||||||
|
|
||||||
sh_binary {
|
sh_binary {
|
||||||
|
|
|
@ -21,7 +21,9 @@
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <sys/sysinfo.h>
|
#include <sys/sysinfo.h>
|
||||||
|
#include <sys/wait.h>
|
||||||
#include <time.h>
|
#include <time.h>
|
||||||
|
#include <unistd.h>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
#include <android-base/file.h>
|
#include <android-base/file.h>
|
||||||
|
@ -629,10 +631,27 @@ void dumpGvoteables() {
|
||||||
|
|
||||||
void dumpMitigation() {
|
void dumpMitigation() {
|
||||||
const char *mitigationList [][2] {
|
const char *mitigationList [][2] {
|
||||||
|
{"LastmealCSV" , "/data/vendor/mitigation/lastmeal.csv"},
|
||||||
{"Lastmeal" , "/data/vendor/mitigation/lastmeal.txt"},
|
{"Lastmeal" , "/data/vendor/mitigation/lastmeal.txt"},
|
||||||
{"Thismeal" , "/data/vendor/mitigation/thismeal.txt"},
|
{"Thismeal" , "/data/vendor/mitigation/thismeal.txt"},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/* parsing thismeal.bin */
|
||||||
|
int status;
|
||||||
|
int pid = fork();
|
||||||
|
if (pid < 0) {
|
||||||
|
printf("Fork failed for parsing thismeal.bin.\n");
|
||||||
|
exit(EXIT_FAILURE);
|
||||||
|
} else if (pid == 0) {
|
||||||
|
execl("/vendor/bin/hw/battery_mitigation", "battery_mitigation", "-d", nullptr);
|
||||||
|
exit(EXIT_SUCCESS);
|
||||||
|
}
|
||||||
|
waitpid(pid, &status, 0);
|
||||||
|
|
||||||
|
if (WIFSIGNALED(status)) {
|
||||||
|
printf("Failed to parse thismeal.bin.(killed by: %d)\n", WTERMSIG(status));
|
||||||
|
}
|
||||||
|
|
||||||
for (auto &row : mitigationList) {
|
for (auto &row : mitigationList) {
|
||||||
if (!isValidFile(row[1]))
|
if (!isValidFile(row[1]))
|
||||||
printTitle(row[0]);
|
printTitle(row[0]);
|
||||||
|
|
3
dumpstate/dump_power.rc
Normal file
3
dumpstate/dump_power.rc
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
on init
|
||||||
|
# for parsing thismeal.bin
|
||||||
|
chown system system /vendor/bin/hw/battery_mitigation
|
Loading…
Add table
Add a link
Reference in a new issue