[Mesa-dev] [PATCH 09/10] i965/miptree: Move the access_raw call to the individual map functions

Pohjolainen, Topi topi.pohjolainen at gmail.com
Mon May 14 17:25:29 UTC 2018


On Fri, May 11, 2018 at 04:48:25PM -0700, Jason Ekstrand wrote:
> The only function that doesn't need to call access_raw is map_blit.  If
> it takes the blitter path, it will happen as part of intel_miptree_copy.
> If map_blit takes the blorp path, no brw_blorp_copy_miptrees will handle

The part starting with "no brw_blorp_copy_miptrees...", I think you just
meant "brw_blorp_copy_miptrees() handles whatever resolves are needed"?

Reviewed-by: Topi Pohjolainen <topi.pohjolainen at intel.com>

> doing whatever resolves are needed.  This should save us resolves in
> quite a few cases and will probably help performance a bit.
> ---
>  src/mesa/drivers/dri/i965/intel_mipmap_tree.c | 16 +++++++++++++---
>  1 file changed, 13 insertions(+), 3 deletions(-)
> 
> diff --git a/src/mesa/drivers/dri/i965/intel_mipmap_tree.c b/src/mesa/drivers/dri/i965/intel_mipmap_tree.c
> index 7c5e6f6..0bfc426 100644
> --- a/src/mesa/drivers/dri/i965/intel_mipmap_tree.c
> +++ b/src/mesa/drivers/dri/i965/intel_mipmap_tree.c
> @@ -3109,6 +3109,9 @@ intel_miptree_map_gtt(struct brw_context *brw,
>     y /= bh;
>     x /= bw;
>  
> +   intel_miptree_access_raw(brw, mt, level, slice,
> +                            map->mode & GL_MAP_WRITE_BIT);
> +
>     base = intel_miptree_map_raw(brw, mt, map->mode);
>  
>     if (base == NULL)
> @@ -3247,6 +3250,8 @@ intel_miptree_map_movntdqa(struct brw_context *brw,
>     assert(map->mode & GL_MAP_READ_BIT);
>     assert(!(map->mode & GL_MAP_WRITE_BIT));
>  
> +   intel_miptree_access_raw(brw, mt, level, slice, false);
> +
>     DBG("%s: %d,%d %dx%d from mt %p (%s) %d,%d = %p/%d\n", __func__,
>         map->x, map->y, map->w, map->h,
>         mt, _mesa_get_format_name(mt->format),
> @@ -3341,6 +3346,9 @@ intel_miptree_map_s8(struct brw_context *brw,
>     if (!map->buffer)
>        return;
>  
> +   intel_miptree_access_raw(brw, mt, level, slice,
> +                            map->mode & GL_MAP_WRITE_BIT);
> +
>     /* One of either READ_BIT or WRITE_BIT or both is set.  READ_BIT implies no
>      * INVALIDATE_RANGE_BIT.  WRITE_BIT needs the original values read in unless
>      * invalidate is set, since we'll be writing the whole rectangle from our
> @@ -3423,6 +3431,8 @@ intel_miptree_map_etc(struct brw_context *brw,
>     assert(map->mode & GL_MAP_WRITE_BIT);
>     assert(map->mode & GL_MAP_INVALIDATE_RANGE_BIT);
>  
> +   intel_miptree_access_raw(brw, mt, level, slice, true);
> +
>     map->stride = _mesa_format_row_stride(mt->etc_format, map->w);
>     map->buffer = malloc(_mesa_format_image_size(mt->etc_format,
>                                                  map->w, map->h, 1));
> @@ -3516,6 +3526,9 @@ intel_miptree_map_depthstencil(struct brw_context *brw,
>     if (!map->buffer)
>        return;
>  
> +   intel_miptree_access_raw(brw, mt, level, slice,
> +                            map->mode & GL_MAP_WRITE_BIT);
> +
>     /* One of either READ_BIT or WRITE_BIT or both is set.  READ_BIT implies no
>      * INVALIDATE_RANGE_BIT.  WRITE_BIT needs the original values read in unless
>      * invalidate is set, since we'll be writing the whole rectangle from our
> @@ -3697,9 +3710,6 @@ intel_miptree_map(struct brw_context *brw,
>        return;
>     }
>  
> -   intel_miptree_access_raw(brw, mt, level, slice,
> -                            map->mode & GL_MAP_WRITE_BIT);
> -
>     if (mt->format == MESA_FORMAT_S_UINT8) {
>        intel_miptree_map_s8(brw, mt, map, level, slice);
>     } else if (mt->etc_format != MESA_FORMAT_NONE &&
> -- 
> 2.5.0.400.gff86faf
> 
> _______________________________________________
> 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