[Mesa-dev] [PATCH v13 30/36] i965: Use partial resolves for CCS buffers being scanned out

Pohjolainen, Topi topi.pohjolainen at gmail.com
Mon May 22 08:01:45 UTC 2017


On Fri, May 19, 2017 at 10:38:13AM +0100, Daniel Stone wrote:
> From: Ben Widawsky <ben at bwidawsk.net>
> 
> On Gen9 hardware, the display engine is able to scanout a compressed
> framebuffer by providing an offset to auxiliary compression information.
> Unfortunately, the hardware is incapable of doing the same thing for the
> fast clear color.
> 
> To mitigate this, the hardware introduced a new resolve type called a
> partial resolve. The partial resolve will only do a resolve of the fast
> clear color and leave the rest of the compressed data alone.
> 
> This patch enables using this resolve type for cases where the
> framebuffer will be passed along to the kernel for display.
> 
> v2: Add early exit from intel_miptree_make_shareable() when it's
> scanout.
> 
> Signed-off-by: Ben Widawsky <ben at bwidawsk.net>
> Acked-by: Daniel Stone <daniels at collabora.com>
> Reviewed-by: Topi Pohjolainen <topi.pohjolainen at intel.com> (v1)
> Signed-off-by: Daniel Stone <daniels at collabora.com>
> ---
>  src/mesa/drivers/dri/i965/brw_context.c       | 3 ++-
>  src/mesa/drivers/dri/i965/intel_mipmap_tree.c | 9 ++++++++-
>  2 files changed, 10 insertions(+), 2 deletions(-)
> 
> diff --git a/src/mesa/drivers/dri/i965/brw_context.c b/src/mesa/drivers/dri/i965/brw_context.c
> index 5e446abb1f..5c209af8d9 100644
> --- a/src/mesa/drivers/dri/i965/brw_context.c
> +++ b/src/mesa/drivers/dri/i965/brw_context.c
> @@ -1374,7 +1374,8 @@ intel_resolve_for_dri2_flush(struct brw_context *brw,
>        if (rb->mt->num_samples <= 1) {
>           assert(rb->mt_layer == 0 && rb->mt_level == 0 &&
>                  rb->layer_count == 1);
> -         intel_miptree_resolve_color(brw, rb->mt, 0, 0, 1, 0);
> +         intel_miptree_resolve_color(brw, rb->mt, 0, 0, 1,
> +                                     INTEL_RESOLVE_HINT_CLEAR_COLOR);
>        } else {
>           intel_renderbuffer_downsample(brw, rb);
>        }
> diff --git a/src/mesa/drivers/dri/i965/intel_mipmap_tree.c b/src/mesa/drivers/dri/i965/intel_mipmap_tree.c
> index 38ab8f9099..e175f990bf 100644
> --- a/src/mesa/drivers/dri/i965/intel_mipmap_tree.c
> +++ b/src/mesa/drivers/dri/i965/intel_mipmap_tree.c
> @@ -2329,7 +2329,14 @@ intel_miptree_make_shareable(struct brw_context *brw,
>     assert(mt->msaa_layout == INTEL_MSAA_LAYOUT_NONE || mt->num_samples <= 1);
>  
>     if (mt->mcs_buf) {
> -      intel_miptree_all_slices_resolve_color(brw, mt, 0);
> +      intel_miptree_all_slices_resolve_color(brw, mt, mt->is_scanout ?
> +                                             INTEL_RESOLVE_HINT_CLEAR_COLOR :
> +                                             INTEL_RESOLVE_HINT_FULL);
> +      if (mt->is_scanout) {

We could also add:

            assert(mt->mcs_buf->offset);

Anyway, this version is also:

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

> +         assert(!mt->hiz_buf);
> +         return;
> +      }
> +
>        mt->aux_disable |= (INTEL_AUX_DISABLE_CCS | INTEL_AUX_DISABLE_MCS);
>        brw_bo_unreference(mt->mcs_buf->bo);
>        free(mt->mcs_buf);
> -- 
> 2.13.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