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 committed Jan 15, 2025
1 parent da634d5 commit c5987e8
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 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,7 +81,7 @@ 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",
if ((property_get("persist.vendor.intel.dGPUwSys.auto",
vendor_buf, NULL) > 0) ||
(property_get("persist.vendor.intel.dGPUwLocal.auto",
vendor_buf1, NULL) > 0)) {
Expand All @@ -101,18 +101,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(app_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 c5987e8

Please sign in to comment.