summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRuofei Ma <ruofeim@google.com>2023-12-11 17:56:49 +0000
committerRuofei Ma <ruofeim@google.com>2023-12-13 22:01:35 +0000
commitdf5b78c130e04e08fa4f1a659685fbd1eaa4f4d5 (patch)
treee49044ec9f7e7bc70edccd3f10ab7aab21d57b84
parentac7161be155028370a7090b308703c72bf0fcded (diff)
downloadgchips-df5b78c130e04e08fa4f1a659685fbd1eaa4f4d5.tar.gz
10bit video is more complicated to decode than 8bit video. Use bit depth in work load calculation to reflect the difference. In this way the driver will vote slightly higher core frequency for 10bit videos. Bug: 309582456 Bug: 275486591 Change-Id: I82e5ee415a6ae0cdeac6546aeb35b8a71f3141d7 Signed-off-by: Ruofei Ma <ruofeim@google.com>
-rw-r--r--bigo_pm.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/bigo_pm.c b/bigo_pm.c
index 871b68f..f56c715 100644
--- a/bigo_pm.c
+++ b/bigo_pm.c
@@ -19,7 +19,7 @@
#define BIGW_A0_CSR_PROG_FREQ 166000
-static inline u32 bigo_get_total_load(struct bigo_core *core)
+static inline u32 bigo_get_total_load(struct bigo_core *core, bool use_bpp)
{
struct bigo_inst *inst;
u32 load = 0;
@@ -32,6 +32,9 @@ static inline u32 bigo_get_total_load(struct bigo_core *core)
if (inst->idle)
continue;
curr_load = (u64)inst->width * inst->height * inst->fps / 1024;
+ if (use_bpp) {
+ curr_load *= inst->bpp;
+ }
if (curr_load < core->pm.max_load - load) {
load += curr_load;
} else {
@@ -84,7 +87,7 @@ static inline void bigo_set_freq(struct bigo_core *core, u32 freq)
static void bigo_scale_freq(struct bigo_core *core)
{
- u32 load = bigo_get_total_load(core);
+ u32 load = bigo_get_total_load(core, true);
u32 freq = bigo_get_target_freq(core, load);
bigo_set_freq(core, freq);
@@ -92,7 +95,7 @@ static void bigo_scale_freq(struct bigo_core *core)
static void bigo_get_bw(struct bigo_core *core, struct bts_bw *bw)
{
- u32 load = bigo_get_total_load(core);
+ u32 load = bigo_get_total_load(core, false);
if (load) {
struct bigo_bw *bandwidth = bigo_get_target_bw(core, load);