Skip to content
This repository was archived by the owner on Jan 27, 2026. It is now read-only.

Commit 0bd48a2

Browse files
committed
Check the config file to detect dgpu render process
The file is placed at /vendor/etc/config.txt where do not need extra policy to read the file. Add the 15 length process name to the config.txt if would like to use dgpu render. Tracked-On: OAM-131149 Signed-off-by: HeYue <yue.he@intel.com>
1 parent fed29ac commit 0bd48a2

File tree

1 file changed

+11
-19
lines changed

1 file changed

+11
-19
lines changed

src/intel/common/intel_check.c

Lines changed: 11 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -69,32 +69,24 @@ use_dgpu_render(char *target)
6969
static bool
7070
is_target_process(const char *target)
7171
{
72-
static const char *str_char[] = { "k.auto:transfer", "android.vending", "k.auto:refinery", ".fisheye", "mark.auto:video", NULL };
73-
const char **ptr = str_char;
74-
7572
// Prefer dGPU for compositing in surfaceflinger since dGPU covers more
7673
// scenarios than iGPU.
7774
if (!strcmp(target, "surfaceflinger"))
7875
return true;
7976

80-
for (ptr = str_char; *ptr != NULL; ptr++) {
81-
if (!strcmp(target, *ptr)) {
82-
char vendor_buf[PROPERTY_VALUE_MAX];
83-
char vendor_buf1[PROPERTY_VALUE_MAX];
84-
if (property_get("persist.vendor.intel.dGPUwSys.auto",
85-
vendor_buf, NULL) > 0) {
86-
if (vendor_buf[0] == '1') {
87-
return true;
88-
}
89-
}
90-
if (property_get("persist.vendor.intel.dGPUwLocal.auto",
91-
vendor_buf1, NULL) > 0) {
92-
if (vendor_buf1[0] == '1') {
93-
return true;
94-
}
95-
}
77+
FILE *file = fopen("/vendor/etc/dgpu-renderwlocal.cfg", "r");
78+
if (!file) {
79+
return false;
80+
}
81+
char line[16];
82+
while (fscanf(file, "%15[^\n]\n", line) != EOF) {
83+
if (!strcmp(target, line)) {
84+
fclose(file);
85+
return true;
9686
}
9787
}
88+
89+
fclose(file);
9890
return false;
9991
}
10092

0 commit comments

Comments
 (0)