[Mesa-dev] [PATCH 16/30] i965/miptree: Move CCS allocation into create_for_dri_image

Jason Ekstrand jason at jlekstrand.net
Fri Jun 16 22:41:38 UTC 2017


Any form of CCS on gen9+ only works on Y-tiled images.  The only caller
of create_for_bo which uses Y-tiled BOs is create_for_dri_image.
---
 src/mesa/drivers/dri/i965/intel_mipmap_tree.c | 25 ++++++++++++-------------
 1 file changed, 12 insertions(+), 13 deletions(-)

diff --git a/src/mesa/drivers/dri/i965/intel_mipmap_tree.c b/src/mesa/drivers/dri/i965/intel_mipmap_tree.c
index 83c99ed..e3de386 100644
--- a/src/mesa/drivers/dri/i965/intel_mipmap_tree.c
+++ b/src/mesa/drivers/dri/i965/intel_mipmap_tree.c
@@ -839,21 +839,9 @@ intel_miptree_create_for_bo(struct brw_context *brw,
    mt->offset = offset;
    mt->tiling = tiling;
 
-   if (!(layout_flags & MIPTREE_LAYOUT_DISABLE_AUX)) {
+   if (!(layout_flags & MIPTREE_LAYOUT_DISABLE_AUX))
       intel_miptree_choose_aux_usage(brw, mt);
 
-      /* Since CCS_E can compress more than just clear color, we create the
-       * CCS for it up-front.  For CCS_D which only compresses clears, we
-       * create the CCS on-demand when a clear occurs that wants one.
-       */
-      if (mt->aux_usage == ISL_AUX_USAGE_CCS_E) {
-         if (!intel_miptree_alloc_ccs(brw, mt)) {
-            intel_miptree_release(&mt);
-            return NULL;
-         }
-      }
-   }
-
    return mt;
 }
 
@@ -955,6 +943,17 @@ intel_miptree_create_for_dri_image(struct brw_context *brw,
       }
    }
 
+   /* Since CCS_E can compress more than just clear color, we create the
+    * CCS for it up-front.  For CCS_D which only compresses clears, we
+    * create the CCS on-demand when a clear occurs that wants one.
+    */
+   if (mt->aux_usage == ISL_AUX_USAGE_CCS_E) {
+      if (!intel_miptree_alloc_ccs(brw, mt)) {
+         intel_miptree_release(&mt);
+         return NULL;
+      }
+   }
+
    return mt;
 }
 
-- 
2.5.0.400.gff86faf



More information about the mesa-dev mailing list