Mesa (master): intel/isl: Clean up some aux surface logic

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Thu Mar 12 18:15:15 UTC 2020


Module: Mesa
Branch: master
Commit: feaedc1fbe43ed4ad4978b9ff6815711ffd640a2
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=feaedc1fbe43ed4ad4978b9ff6815711ffd640a2

Author: Jason Ekstrand <jason at jlekstrand.net>
Date:   Thu Mar  5 11:30:59 2020 -0600

intel/isl: Clean up some aux surface logic

The first check is redundant because the first thing we do in the "emit
the aux surface" section is assert that we actually have an aux_surf.
The second check involves an exclusion list of things which don't have
aux surfaces on Gen12 but an inclusion list is much simpler because it's
just "does it have MCS?".

Reviewed-by: Nanley Chery <nanley.g.chery at intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4056>

---

 src/intel/isl/isl_surface_state.c | 26 +++++++++++---------------
 1 file changed, 11 insertions(+), 15 deletions(-)

diff --git a/src/intel/isl/isl_surface_state.c b/src/intel/isl/isl_surface_state.c
index c66f09b4b68..e44e16c87fa 100644
--- a/src/intel/isl/isl_surface_state.c
+++ b/src/intel/isl/isl_surface_state.c
@@ -574,15 +574,6 @@ isl_genX(surf_fill_state_s)(const struct isl_device *dev, void *state,
                 info->aux_usage == ISL_AUX_USAGE_CCS_D);
       }
 
-      if (GEN_GEN >= 12) {
-         /* We don't need an auxiliary surface for CCS on gen12+ */
-         assert (info->aux_usage == ISL_AUX_USAGE_CCS_E ||
-                 info->aux_usage == ISL_AUX_USAGE_MC || info->aux_surf);
-      } else {
-         /* We must have an auxiliary surface */
-         assert(info->aux_surf);
-      }
-
       /* The docs don't appear to say anything whatsoever about compression
        * and the data port.  Testing seems to indicate that the data port
        * completely ignores the AuxiliarySurfaceMode field.
@@ -615,13 +606,18 @@ isl_genX(surf_fill_state_s)(const struct isl_device *dev, void *state,
 #endif
    }
 
-   /* The auxiliary buffer info is filled when it's useable by the HW. On
-    * gen12 and above, CCS is controlled by the aux table and not the
-    * auxiliary surface information in SURFACE_STATE.
+   /* The auxiliary buffer info is filled when it's useable by the HW.
+    *
+    * Starting with Gen12, the only form of compression that can be used
+    * with RENDER_SURFACE_STATE which requires an aux surface is MCS.
+    * HiZ still requires a surface but the HiZ surface can only be
+    * accessed through 3DSTATE_HIER_DEPTH_BUFFER.
+    *
+    * On all earlier hardware, an aux surface is required for all forms
+    * of compression.
     */
-   if (info->aux_usage != ISL_AUX_USAGE_NONE &&
-       ((info->aux_usage != ISL_AUX_USAGE_MC &&
-         info->aux_usage != ISL_AUX_USAGE_CCS_E) || GEN_GEN <= 11)) {
+   if ((GEN_GEN < 12 && info->aux_usage != ISL_AUX_USAGE_NONE) ||
+       (GEN_GEN >= 12 && isl_aux_usage_has_mcs(info->aux_usage))) {
 
       assert(info->aux_surf != NULL);
 



More information about the mesa-commit mailing list