[Mesa-dev] [PATCH 26/27] i965: Remove scanout restriction from lossless compression

Pohjolainen, Topi topi.pohjolainen at gmail.com
Sun Dec 11 08:05:25 UTC 2016


On Thu, Dec 01, 2016 at 02:10:07PM -0800, Ben Widawsky wrote:
> From: Ben Widawsky <ben at bwidawsk.net>
> 
> Cc: Topi Pohjolainen <topi.pohjolainen at intel.com>
> Signed-off-by: Ben Widawsky <ben at bwidawsk.net>
> ---
>  src/mesa/drivers/dri/i965/intel_mipmap_tree.c | 12 +++---------
>  1 file changed, 3 insertions(+), 9 deletions(-)
> 
> diff --git a/src/mesa/drivers/dri/i965/intel_mipmap_tree.c b/src/mesa/drivers/dri/i965/intel_mipmap_tree.c
> index b79de08..b297f79 100644
> --- a/src/mesa/drivers/dri/i965/intel_mipmap_tree.c
> +++ b/src/mesa/drivers/dri/i965/intel_mipmap_tree.c
> @@ -157,7 +157,7 @@ intel_miptree_supports_non_msrt_fast_clear(struct brw_context *brw,
>     if (mt->disable_aux_buffers)
>        return false;
>  
> -   if (mt->is_scanout)
> +   if (mt->is_scanout && mt->msaa_layout != INTEL_MSAA_LAYOUT_CMS)

I guess the same question I had in previous becomes more general. How do we
know that the external consumer is prepared for compression (mt->is_scanout
just tells that the buffer goes out from the driver, right)?

>        return false;
>  
>     /* This function applies only to non-multisampled render targets. */
> @@ -528,10 +528,6 @@ intel_miptree_create_layout(struct brw_context *brw,
>        const UNUSED bool is_lossless_compressed_aux =
>           brw->gen >= 9 && num_samples == 1 &&
>           mt->format == MESA_FORMAT_R_UINT32;
> -
> -      /* For now, nothing else has this requirement */
> -      assert(is_lossless_compressed_aux ||
> -             (layout_flags & MIPTREE_LAYOUT_FORCE_HALIGN16) == 0);

Why do we need to drop this? And if we do, then we can drop the entire
else-branch, "is_lossless_compressed_aux" is only used in the assertion.

>     }
>  
>     brw_miptree_layout(brw, mt, layout_flags);
> @@ -752,11 +748,9 @@ intel_miptree_create(struct brw_context *brw,
>         * resolves.
>         */
>        const bool lossless_compression_disabled = INTEL_DEBUG & DEBUG_NO_RBC;
> -      assert(!mt->is_scanout);
>        const bool is_lossless_compressed =
>           unlikely(!lossless_compression_disabled) &&
> -         brw->gen >= 9 && !mt->is_scanout &&
> -         intel_miptree_supports_lossless_compressed(brw, mt);
> +         brw->gen >= 9 && intel_miptree_supports_lossless_compressed(brw, mt);
>  
>        if (is_lossless_compressed) {
>           intel_miptree_alloc_non_msrt_mcs(brw, mt, is_lossless_compressed);
> @@ -1043,7 +1037,7 @@ intel_miptree_release(struct intel_mipmap_tree **mt)
>              drm_intel_bo_unreference((*mt)->hiz_buf->aux_base.bo);
>           free((*mt)->hiz_buf);
>        }
> -      if ((*mt)->mcs_buf && !(*mt)->is_scanout) {
> +      if ((*mt)->mcs_buf) {
>           drm_intel_bo_unreference((*mt)->mcs_buf->bo);
>           free((*mt)->mcs_buf);
>        }
> -- 
> 2.10.2
> 
> _______________________________________________
> 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