From 08699ed9da150af929b6ba18c48d520b03d0778e Mon Sep 17 00:00:00 2001 From: "He, Yue" Date: Tue, 20 Aug 2024 23:16:29 +0000 Subject: [PATCH] Change to check the app name instead of process name Signed-off-by: He, Yue --- src/intel/common/intel_check.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/intel/common/intel_check.c b/src/intel/common/intel_check.c index 42b679251aa..51c144810c2 100644 --- a/src/intel/common/intel_check.c +++ b/src/intel/common/intel_check.c @@ -1,3 +1,4 @@ +#include #include #include #include @@ -7,6 +8,7 @@ #include #include #include +#include #include #include "util/macros.h" #include "util/log.h" @@ -42,7 +44,7 @@ use_dgpu_render(char *target) {    char dGPU_prop[BUF_SIZE];    char vendor_buf[PROPERTY_VALUE_MAX]; -   sprintf(dGPU_prop, "persist.vendor.intel.dGPU.%s",target); +   sprintf(dGPU_prop, "persist.vendor.intel.dGPU%s",target);    if (property_get(dGPU_prop, vendor_buf, NULL) > 0) {       if (vendor_buf[0] == '1') {          return true; @@ -77,7 +79,8 @@ bool intel_is_dgpu_render(void) { char process_name[BUF_SIZE]; get_pid_name(process_id, process_name); - return (use_dgpu_render(process_name) || is_target_process(process_name)); + char *app_name = strrchr(process_name, '.'); + return (use_dgpu_render(app_name) || is_target_process(process_name)); } bool intel_lower_ctx_priority(void) @@ -85,10 +88,11 @@ bool intel_lower_ctx_priority(void) pid_t process_id = getpid(); char process_name[BUF_SIZE]; get_pid_name(process_id, process_name); + char *app_name = strrchr(process_name, '.');    char lower_pri[BUF_SIZE];    char vendor_buf[PROPERTY_VALUE_MAX]; -   sprintf(lower_pri, "persist.vendor.intel.lowPir.%s",process_name); +   sprintf(lower_pri, "persist.vendor.intel.lowPir%s",app_name);    if (property_get(lower_pri, vendor_buf, NULL) > 0) {       if (vendor_buf[0] == '1') {          return true;