[Mesa-dev] [PATCH 09/13] i965/miptree: Share alloc_flags in miptree_create

Pohjolainen, Topi topi.pohjolainen at gmail.com
Fri Jul 6 12:06:02 UTC 2018


On Tue, Jun 12, 2018 at 12:22:01PM -0700, Nanley Chery wrote:
> ---
>  src/mesa/drivers/dri/i965/intel_mipmap_tree.c | 11 ++++-------
>  1 file changed, 4 insertions(+), 7 deletions(-)
> 
> diff --git a/src/mesa/drivers/dri/i965/intel_mipmap_tree.c b/src/mesa/drivers/dri/i965/intel_mipmap_tree.c
> index 97de30076e0..cfb83d15ecc 100644
> --- a/src/mesa/drivers/dri/i965/intel_mipmap_tree.c
> +++ b/src/mesa/drivers/dri/i965/intel_mipmap_tree.c
> @@ -690,6 +690,8 @@ miptree_create(struct brw_context *brw,
>                 enum intel_miptree_create_flags flags)
>  {
>     const struct gen_device_info *devinfo = &brw->screen->devinfo;
> +   const uint32_t alloc_flags = (flags & MIPTREE_CREATE_BUSY) ?
> +                                BO_ALLOC_BUSY : 0;
>     isl_tiling_flags_t tiling_flags = ISL_TILING_ANY_MASK;
>  
>     /* TODO: This used to be because there wasn't BLORP to handle Y-tiling. */
> @@ -713,7 +715,7 @@ miptree_create(struct brw_context *brw,
>                            tiling_flags,
>                            ISL_SURF_USAGE_STENCIL_BIT |
>                            ISL_SURF_USAGE_TEXTURE_BIT,
> -                          BO_ALLOC_BUSY,
> +                          alloc_flags,

Only intel_finalize_mipmap_tree(), intel_renderbuffer_move_to_temp() and
intel_miptree_create_for_renderbuffer() use MIPTREE_CREATE_BUSY. Can we end
up here for somewhere else?

>                            0,
>                            NULL);
>  
> @@ -725,7 +727,7 @@ miptree_create(struct brw_context *brw,
>           first_level, last_level,
>           width0, height0, depth0, num_samples, tiling_flags,
>           ISL_SURF_USAGE_DEPTH_BIT | ISL_SURF_USAGE_TEXTURE_BIT,
> -         BO_ALLOC_BUSY, 0, NULL);
> +         alloc_flags, 0, NULL);

Same question here?

>  
>        if (needs_separate_stencil(brw, mt, format) &&
>            !make_separate_stencil_surface(brw, mt)) {
> @@ -739,11 +741,6 @@ miptree_create(struct brw_context *brw,
>        return mt;
>     }
>  
> -   uint32_t alloc_flags = 0;
> -
> -   if (flags & MIPTREE_CREATE_BUSY)
> -      alloc_flags |= BO_ALLOC_BUSY;
> -
>     struct intel_mipmap_tree *mt = make_surface(
>                                       brw, target, mt_fmt,
>                                       first_level, last_level,
> -- 
> 2.17.0
> 
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev


More information about the mesa-dev mailing list