<div dir="ltr"><div>Chad, you missed this one.<br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Jul 12, 2017 at 9:23 PM, Jason Ekstrand <span dir="ltr"><<a href="mailto:jason@jlekstrand.net" target="_blank">jason@jlekstrand.net</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">---<br>
 src/mesa/drivers/dri/i965/<wbr>intel_mipmap_tree.c | 36 ++++++++++-----------------<br>
 1 file changed, 13 insertions(+), 23 deletions(-)<br>
<br>
diff --git a/src/mesa/drivers/dri/i965/<wbr>intel_mipmap_tree.c b/src/mesa/drivers/dri/i965/<wbr>intel_mipmap_tree.c<br>
index fc7b48f..fea19a8 100644<br>
--- a/src/mesa/drivers/dri/i965/<wbr>intel_mipmap_tree.c<br>
+++ b/src/mesa/drivers/dri/i965/<wbr>intel_mipmap_tree.c<br>
@@ -1837,13 +1837,20 @@ intel_miptree_alloc_ccs(struct brw_context *brw,<br>
    if (!aux_state)<br>
       return false;<br>
<br>
-   /* In case of compression mcs buffer needs to be initialised requiring the<br>
-    * buffer to be immediately mapped to cpu space for writing. Therefore do<br>
-    * not use the gpu access flag which can cause an unnecessary delay if the<br>
-    * backing pages happened to be just used by the GPU.<br>
+   /* When CCS_E is used, we need to ensure that the CCS starts off in a valid<br>
+    * state.  From the Sky Lake PRM, "MCS Buffer for Render Target(s)":<br>
+    *<br>
+    *    "If Software wants to enable Color Compression without Fast clear,<br>
+    *    Software needs to initialize MCS with zeros."<br>
+    *<br>
+    * A CCS value of 0 indicates that the corresponding block is in the<br>
+    * pass-through state which is what we want.<br>
+    *<br>
+    * For CCS_D, on the other hand, we don't care as we're about to perform a<br>
+    * fast-clear operation.  In that case, being hot in caches more useful.<br>
     */<br>
-   const uint32_t alloc_flags =<br>
-      mt->aux_usage == ISL_AUX_USAGE_CCS_E ? 0 : BO_ALLOC_FOR_RENDER;<br>
+   const uint32_t alloc_flags = mt->aux_usage == ISL_AUX_USAGE_CCS_E ?<br>
+                                BO_ALLOC_ZEROED : BO_ALLOC_FOR_RENDER;<br>
    mt->mcs_buf = intel_alloc_aux_buffer(brw, "ccs-miptree",<br>
                                         &temp_ccs_surf, alloc_flags, mt);<br>
    if (!mt->mcs_buf) {<br>
@@ -1853,23 +1860,6 @@ intel_miptree_alloc_ccs(struct brw_context *brw,<br>
<br>
    mt->aux_state = aux_state;<br>
<br>
-   /* From Gen9 onwards single-sampled (non-msrt) auxiliary buffers are<br>
-    * used for lossless compression which requires similar initialisation<br>
-    * as multi-sample compression.<br>
-    */<br>
-   if (mt->aux_usage == ISL_AUX_USAGE_CCS_E) {<br>
-      /* Hardware sets the auxiliary buffer to all zeroes when it does full<br>
-       * resolve. Initialize it accordingly in case the first renderer is<br>
-       * cpu (or other none compression aware party).<br>
-       *<br>
-       * This is also explicitly stated in the spec (MCS Buffer for Render<br>
-       * Target(s)):<br>
-       *   "If Software wants to enable Color Compression without Fast clear,<br>
-       *    Software needs to initialize MCS with zeros."<br>
-       */<br>
-      intel_miptree_init_mcs(brw, mt, 0);<br>
-   }<br>
-<br>
    return true;<br>
 }<br>
<span class="HOEnZb"><font color="#888888"><br>
--<br>
2.5.0.400.gff86faf<br>
<br>
</font></span></blockquote></div><br></div>