[Mesa-dev] [PATCH] anv: implement VK_EXT_global_priority extension

Chris Wilson chris at chris-wilson.co.uk
Fri Jan 19 11:00:24 UTC 2018


Quoting Tapani Pälli (2018-01-19 10:44:49)
> diff --git a/src/intel/vulkan/anv_gem.c b/src/intel/vulkan/anv_gem.c
> index 34c0989108..46069dcdc7 100644
> --- a/src/intel/vulkan/anv_gem.c
> +++ b/src/intel/vulkan/anv_gem.c
> @@ -302,6 +302,55 @@ close_and_return:
>     return swizzled;
>  }
>  
> +static int
> +vk_priority_to_anv(int priority)
> +{
> +   switch (priority) {
> +   case VK_QUEUE_GLOBAL_PRIORITY_LOW_EXT:
> +      return ANV_CONTEXT_LOW_PRIORITY;
> +   case VK_QUEUE_GLOBAL_PRIORITY_MEDIUM_EXT:
> +      return ANV_CONTEXT_MEDIUM_PRIORITY;
> +   case VK_QUEUE_GLOBAL_PRIORITY_HIGH_EXT:
> +      return ANV_CONTEXT_HIGH_PRIORITY;
> +   case VK_QUEUE_GLOBAL_PRIORITY_REALTIME_EXT:

/* We don't have a strict notion of RT (yet, and when we do it is likely
 * to be more complicated than a mere priority value!), but we can give
 * it the absolute most priority available to us. By convention, this
 * is higher than any other client, except for blocked interactive
 * clients.
 */
#define ANV_CONTEXT_RT_PRIORITY I915_CONTEXT_MAX_USER_PRIORITY
	return ANV_CONTEXT_RT_PRIORITY;
-Chris


More information about the mesa-dev mailing list