isl: require hiz for depth surface in isl_surf_get_ccs_surf
authorTapani Pälli <tapani.palli@intel.com>
Wed, 12 May 2021 12:19:43 +0000 (15:19 +0300)
committerTapani Pälli <tapani.palli@intel.com>
Thu, 13 May 2021 14:18:54 +0000 (17:18 +0300)
Fixes: 752eefdb ("intel/isl: Refactor isl_surf_get_ccs_surf")
Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10768>

src/intel/isl/isl.c

index c9d8519..d2a9e2c 100644 (file)
@@ -2116,6 +2116,11 @@ isl_surf_get_ccs_surf(const struct isl_device *dev,
       return false;
 
    if (ISL_GFX_VER(dev) >= 12) {
+      /* With depth surfaces, HIZ is required for CCS. */
+      if (surf->usage & ISL_SURF_USAGE_DEPTH_BIT &&
+          aux_surf->tiling != ISL_TILING_HIZ)
+         return false;
+
       enum isl_format ccs_format;
       switch (isl_format_get_layout(surf->format)->bpb) {
       case 8:     ccs_format = ISL_FORMAT_GFX12_CCS_8BPP_Y0;    break;