[Mesa-dev] [PATCH 1/4] intel/isl: Add a drm_modifier_get_default_aux_state helper

Chad Versace chadversary at chromium.org
Mon Sep 18 15:38:58 UTC 2017


On Tue 12 Sep 2017, Jason Ekstrand wrote:
> ---
>  src/intel/isl/isl.h                           | 20 ++++++++++++++++++++
>  src/mesa/drivers/dri/i965/intel_mipmap_tree.c |  3 +--
>  2 files changed, 21 insertions(+), 2 deletions(-)
> 
> diff --git a/src/intel/isl/isl.h b/src/intel/isl/isl.h
> index e77d7ee..d30b2de 100644
> --- a/src/intel/isl/isl.h
> +++ b/src/intel/isl/isl.h
> @@ -1558,6 +1558,26 @@ isl_drm_modifier_has_aux(uint64_t modifier)
>     return isl_drm_modifier_get_info(modifier)->aux_usage != ISL_AUX_USAGE_NONE;
>  }
>  
> +/** Returns the default isl_aux_state for the given modifier.
> + *
> + * All modified images are required to be kept out of the AUX_INVALID state
> + * but they may or may not actually be compressed and may or may not have
> + * clear color.  This function returns the worst case aux_state that we need
> + * to assume when getting a surface from another process or API.
> + */
> +static inline enum isl_aux_state
> +isl_drm_modifier_get_default_aux_state(uint64_t modifier)
> +{

I wish the function name better reflected what it returns. What it
returns is not really a "default" state, it's more
a "lowest-common-denomiator" state that the surface enters when during
transfer. Hmmm... maybe we could call it a "transfer" state or "lcd"
state.

Whatever... the code looks good, and the name is, though imprecise, at
least not misleading.

Reviewed-by: Chad Versace <chadversary at chromium.org>



More information about the mesa-dev mailing list