mirror of
https://gitlab.freedesktop.org/mesa/drm.git
synced 2025-12-20 04:40:09 +01:00
amdgpu: add an environment variable that overrides the context priority
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
This commit is contained in:
parent
7784d57166
commit
98e1db5011
1 changed files with 12 additions and 0 deletions
|
|
@ -56,10 +56,22 @@ drm_public int amdgpu_cs_ctx_create2(amdgpu_device_handle dev,
|
|||
union drm_amdgpu_ctx args;
|
||||
int i, j, k;
|
||||
int r;
|
||||
char *override_priority;
|
||||
|
||||
if (!dev || !context)
|
||||
return -EINVAL;
|
||||
|
||||
override_priority = getenv("AMD_PRIORITY");
|
||||
if (override_priority) {
|
||||
/* The priority is a signed integer. The variable type is
|
||||
* wrong. If parsing fails, priority is unchanged.
|
||||
*/
|
||||
if (sscanf(override_priority, "%i", &priority) == 1) {
|
||||
printf("amdgpu: context priority changed to %i\n",
|
||||
priority);
|
||||
}
|
||||
}
|
||||
|
||||
gpu_context = calloc(1, sizeof(struct amdgpu_context));
|
||||
if (!gpu_context)
|
||||
return -ENOMEM;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue