Skip to content

Commit

Permalink
Change to check the app name
Browse files Browse the repository at this point in the history
Some app has error while setting the dGPU relate property
using the process name, like the .benchmark.auto.
Change to use app name instead.
      persist.vendor.intel.dGPUwSys+app_name
      persist.vendor.intel.dGPUwLocal+app_name

Tracked-On: OAM-129468
Signed-off-by: He, Yue <[email protected]>
  • Loading branch information
yhe39 authored and sysopenci committed Jan 17, 2025
1 parent da634d5 commit 7883b6a
Showing 1 changed file with 17 additions and 8 deletions.
25 changes: 17 additions & 8 deletions src/intel/common/intel_check.c
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ use_dgpu_render(char *target)
{
char dGPU_prop[BUF_SIZE];
char vendor_buf[PROPERTY_VALUE_MAX];
snprintf(dGPU_prop, sizeof(dGPU_prop), "persist.vendor.intel.dGPUwSys.%s", target);
snprintf(dGPU_prop, sizeof(dGPU_prop), "persist.vendor.intel.dGPUwSys%s", target);
if (property_get(dGPU_prop, vendor_buf, NULL) > 0) {
if (vendor_buf[0] == '1') {
return true;
Expand Down Expand Up @@ -81,11 +81,15 @@ is_target_process(const char *target)
if (!strcmp(target, *ptr)) {
char vendor_buf[PROPERTY_VALUE_MAX];
char vendor_buf1[PROPERTY_VALUE_MAX];
if ((property_get("persist.vendor.intel.dGPUwSys.benchmark.auto",
vendor_buf, NULL) > 0) ||
(property_get("persist.vendor.intel.dGPUwLocal.auto",
vendor_buf1, NULL) > 0)) {
if ((vendor_buf[0] == '1') || (vendor_buf1[0] == '1')) {
if (property_get("persist.vendor.intel.dGPUwSys.auto",
vendor_buf, NULL) > 0) {
if (vendor_buf[0] == '1') {
return true;
}
}
if (property_get("persist.vendor.intel.dGPUwLocal.auto",
vendor_buf1, NULL) > 0) {
if (vendor_buf1[0] == '1') {
return true;
}
}
Expand All @@ -101,18 +105,23 @@ bool intel_is_dgpu_render(void)

get_pid_name(process_id, process_name);
char *app_name = strrchr(process_name, '.');
return (use_dgpu_render(process_name) || is_target_process(process_name) || use_dgpu_render(app_name));
if (app_name == NULL)
app_name = process_name;
return (use_dgpu_render(app_name) || is_target_process(process_name));
}

bool intel_lower_ctx_priority(void)
{
pid_t process_id = getpid();
char process_name[BUF_SIZE] = {0};
get_pid_name(process_id, process_name);
char *app_name = strrchr(process_name, '.');
if (app_name == NULL)
app_name = process_name;

char lower_pri[BUF_SIZE];
char vendor_buf[PROPERTY_VALUE_MAX];
snprintf(lower_pri, sizeof(lower_pri), "persist.vendor.intel.lowPir.%s", process_name);
snprintf(lower_pri, sizeof(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;
Expand Down

0 comments on commit 7883b6a

Please sign in to comment.