isl: add helper to check if aux usage is CCS_E
authorRohan Garg <rohan.garg@intel.com>
Tue, 9 May 2023 18:17:13 +0000 (20:17 +0200)
committerMarge Bot <emma+marge@anholt.net>
Mon, 29 May 2023 16:48:47 +0000 (16:48 +0000)
Signed-off-by: Rohan Garg <rohan.garg@intel.com>
Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22076>

src/intel/isl/isl.h
src/intel/isl/isl_surface_state.c

index 442c0fc..f0b943f 100644 (file)
@@ -2211,6 +2211,13 @@ isl_aux_usage_has_ccs(enum isl_aux_usage usage)
 }
 
 static inline bool
+isl_aux_usage_has_ccs_e(enum isl_aux_usage usage)
+{
+   return usage == ISL_AUX_USAGE_CCS_E ||
+          usage == ISL_AUX_USAGE_GFX12_CCS_E;
+}
+
+static inline bool
 isl_aux_state_has_valid_primary(enum isl_aux_state state)
 {
    return state == ISL_AUX_STATE_RESOLVED ||
index 72f433b..90cd640 100644 (file)
@@ -695,8 +695,7 @@ isl_genX(surf_fill_state_s)(const struct isl_device *dev, void *state,
        *
        * If CCS_E is in use, the format must support it.
        */
-      if (info->aux_usage == ISL_AUX_USAGE_CCS_E ||
-          info->aux_usage == ISL_AUX_USAGE_GFX12_CCS_E)
+      if (isl_aux_usage_has_ccs_e(info->aux_usage))
          assert(isl_format_supports_ccs_e(dev->info, info->view->format));
 
       /* It also says: