Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Angle vulkan #143

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/intel/vulkan/anv_device.c
Original file line number Diff line number Diff line change
Expand Up @@ -1968,12 +1968,12 @@ anv_override_engine_counts(int *gc_count, int *g_count, int *c_count, int *v_cou
int g_override = -1;
int c_override = -1;
int v_override = -1;
char *env = getenv("ANV_QUEUE_OVERRIDE");
const char *env_ = os_get_option("ANV_QUEUE_OVERRIDE");

if (env == NULL)
if (env_ == NULL)
return;

env = strdup(env);
char *env = strdup(env_);
char *save = NULL;
char *next = strtok_r(env, ",", &save);
while (next != NULL) {
Expand Down
6 changes: 3 additions & 3 deletions src/intel/vulkan_hasvk/anv_device.c
Original file line number Diff line number Diff line change
Expand Up @@ -875,12 +875,12 @@ anv_override_engine_counts(int *gc_count, int *g_count, int *c_count)
int gc_override = -1;
int g_override = -1;
int c_override = -1;
char *env = getenv("ANV_QUEUE_OVERRIDE");
const char *env_ = os_get_option("ANV_QUEUE_OVERRIDE");

if (env == NULL)
if (env_ == NULL)
return;

env = strdup(env);
char *env = strdup(env_);
char *save = NULL;
char *next = strtok_r(env, ",", &save);
while (next != NULL) {
Expand Down
18 changes: 14 additions & 4 deletions src/util/os_misc.c
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,10 @@ os_log_message(const char *message)
*
* 1) convert to lowercase
* 2) replace '_' with '.'
* 3) if necessary, prepend "mesa."
* 3) replace "MESA_" or prepend with "mesa."
* 4) look for "debug.mesa." prefix
* 5) look for "vendor.mesa." prefix
* 6) look for "mesa." prefix
*
* For example:
* - MESA_EXTENSION_OVERRIDE -> mesa.extension.override
Expand All @@ -167,9 +170,16 @@ os_get_android_option(const char *name)
}
}

int len = property_get(key, os_android_option_value, NULL);
if (len > 1) {
return os_android_option_value;
/* prefixes to search sorted by preference */
const char *prefices[] = { "debug.", "vendor.", "" };
char full_key[PROPERTY_KEY_MAX];
int len = 0;
for (int i = 0; i < ARRAY_SIZE(prefices); i++) {
strlcpy(full_key, prefices[i], PROPERTY_KEY_MAX);
strlcat(full_key, key, PROPERTY_KEY_MAX);
len = property_get(full_key, os_android_option_value, NULL);
if (len > 0)
return os_android_option_value;
}
return NULL;
}
Expand Down