On 16-12-11 10:05:25, Pohjolainen, Topi wrote:
On Thu, Dec 01, 2016 at 02:10:07PM -0800, Ben Widawsky wrote:
From: Ben Widawsky <b...@bwidawsk.net>

Cc: Topi Pohjolainen <topi.pohjolai...@intel.com>
Signed-off-by: Ben Widawsky <b...@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)?


Preparedness should have been determined by the graphics application (perhaps
via the display server). The graphics application, using get_plane2 or some
other magic, will determine that the external consumer can handle compression,
and will then use the CCS modifiers upon buffer creation. This is the only way
is_scanout && msaa_layout == INTEL_MSAA_LAYOUT_CMS, see
create_ccs_buf_for_image().

       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.


This might have been because of my bug for not having the layout flags set
appropriately in an earlier version of my patches. I think the assertion should
stay here, and I put it back.

Thanks.

    }

    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@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev
_______________________________________________
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev

Reply via email to