summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRuofei Ma <ruofeim@google.com>2022-08-25 04:08:25 +0000
committerRuofei Ma <ruofeim@google.com>2022-09-14 14:18:27 -0700
commit6665e47abc9109b26e68e30165acd34837905abd (patch)
treef91024e8a82c2346c152556d144ed0bc52dbb5b8
parentc89662c3e3e8bc83bf84bb626462c9d16d30f204 (diff)
downloadgchips-6665e47abc9109b26e68e30165acd34837905abd.tar.gz
Set instance to idle at open
By setting instance to idle at open, we a delaying the power/freq vote until there is activity from this particular instance. This change can avoid unnecessary power comsumption on the instances that are opened but have no activity. Without the change the statement above only works for the first instance. With this change it works for all instances. Refer to the bug for details. Bug: 242975531 Bug: 237706931 Signed-off-by: Ruofei Ma <ruofeim@google.com> Change-Id: I009769a94d239a7ab8a6874288d7bfb400379848 (cherry picked from commit fc2b92d03a6311c32e836feb9fe3488e9ded2561)
-rw-r--r--bigo.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/bigo.c b/bigo.c
index e80c36d..1b99803 100644
--- a/bigo.c
+++ b/bigo.c
@@ -152,6 +152,7 @@ static int bigo_open(struct inode *inode, struct file *file)
inst->fps = DEFAULT_FPS;
inst->bpp = 1;
inst->core = core;
+ inst->idle = true;
inst->job.regs_size = core->regs_size;
inst->job.regs = kzalloc(core->regs_size, GFP_KERNEL);
if (!inst->job.regs) {
@@ -628,7 +629,12 @@ static int bigo_worker_thread(void *data)
continue;
inst = container_of(job, struct bigo_inst, job);
- inst->idle = false;
+
+ if (inst->idle) {
+ inst->idle = false;
+ bigo_mark_qos_dirty(core);
+ }
+
bigo_update_qos(core);
if (inst->is_secure) {
rc = exynos_smc(SMC_PROTECTION_SET, 0, BIGO_SMC_ID,