[Mesa-dev] [PATCH V2 06/22] i965/gen9: Set tiled resource mode for the miptree

Daniel Vetter daniel at ffwll.ch
Wed May 6 06:34:17 PDT 2015


On Fri, Apr 17, 2015 at 04:51:27PM -0700, Anuj Phogat wrote:
> Signed-off-by: Anuj Phogat <anuj.phogat at gmail.com>
> ---
>  src/mesa/drivers/dri/i965/brw_tex_layout.c    | 2 ++
>  src/mesa/drivers/dri/i965/intel_mipmap_tree.h | 6 ++++++
>  2 files changed, 8 insertions(+)
> 
> diff --git a/src/mesa/drivers/dri/i965/brw_tex_layout.c b/src/mesa/drivers/dri/i965/brw_tex_layout.c
> index 68c6634..19ff5b8 100644
> --- a/src/mesa/drivers/dri/i965/brw_tex_layout.c
> +++ b/src/mesa/drivers/dri/i965/brw_tex_layout.c
> @@ -540,6 +540,8 @@ brw_miptree_layout(struct brw_context *brw,
>  {
>     bool gen6_hiz_or_stencil = false;
>  
> +   mt->tr_mode = INTEL_MIPTREE_TRMODE_NONE;
> +
>     if (brw->gen == 6 && mt->array_layout == ALL_SLICES_AT_EACH_LOD) {
>        const GLenum base_format = _mesa_get_format_base_format(mt->format);
>        gen6_hiz_or_stencil = _mesa_is_depth_or_stencil_format(base_format);
> diff --git a/src/mesa/drivers/dri/i965/intel_mipmap_tree.h b/src/mesa/drivers/dri/i965/intel_mipmap_tree.h
> index b03ffe7..2669817 100644
> --- a/src/mesa/drivers/dri/i965/intel_mipmap_tree.h
> +++ b/src/mesa/drivers/dri/i965/intel_mipmap_tree.h
> @@ -338,6 +338,7 @@ struct intel_mipmap_tree
>     uint32_t pitch; /**< pitch in bytes. */
>  
>     uint32_t tiling; /**< One of the I915_TILING_* flags */
> +   uint32_t tr_mode; /**< One of the INTEL_MIPTREE_TRMODE_* flags */
>  
>     /* Effectively the key:
>      */
> @@ -503,6 +504,11 @@ enum intel_miptree_tiling_mode {
>     INTEL_MIPTREE_TILING_NONE,
>  };
>  
> +/* Tile resource modes */
> +#define   INTEL_MIPTREE_TRMODE_NONE    0
> +#define   INTEL_MIPTREE_TRMODE_YF      1
> +#define   INTEL_MIPTREE_TRMODE_YS      2

The idea (well part of it) with the kernel's fb modifier we've added for
kernel-side Y-tiling scanout support was that userspace could reuse these
too. Doesn't matter for driver-internal usage, but will be important for
buffer sharing with the compositor. But I guess that can be changed once
that happens.

Aside: The kernel lacks a define for Ys right now, but that was simply an
oversight since mesa patches didn't exist back then yet.
-Daniel
-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch


More information about the mesa-dev mailing list