power: Add property check for EXPENSIVE_RENDERING

Detect the support status of EXPENSIVE_RENDERING mode based on the
vendor property, which can be configured per target.

Change-Id: I39ed53f5df506bb8b7a714138d35e5b29bcfa4a5
CRs-Fixed: 3364809
This commit is contained in:
Jun Wang
2022-12-15 15:21:34 +08:00
parent 92e50efac0
commit a76131a3c1
5 changed files with 35 additions and 0 deletions

16
utils.c
View File

@@ -56,6 +56,7 @@ static int (*perf_lock_acq)(int handle, int duration,
int list[], int numArgs);
static int (*perf_lock_rel)(int handle);
static int (*perf_hint)(int, const char *, int, int);
static PropVal (*perf_get_prop)(const char *prop , const char *def_val);
static struct list_node active_hint_list_head;
const char *pkg = "QTI PowerHAL";
@@ -102,6 +103,11 @@ static void __attribute__ ((constructor)) initialize(void)
if (!perf_hint) {
ALOGE("Unable to get perf_hint function handle.\n");
}
perf_get_prop = dlsym(qcopt_handle, "perf_get_prop");
if (!perf_get_prop) {
ALOGE("Unable to get perf_get_prop function handle.\n");
}
}
}
@@ -210,6 +216,16 @@ int is_interactive_governor(char* governor) {
return 0;
}
PropVal perf_get_property(const char *prop , const char *def_val) {
PropVal retVal;
if (qcopt_handle && perf_get_prop) {
retVal = perf_get_prop(prop, def_val);
} else {
strlcpy(retVal.value, def_val, PROPERTY_VALUE_MAX);
}
return retVal;
}
void interaction(int duration, int num_args, int opt_list[])
{
#ifdef INTERACTION_BOOST