iris: Remove the CCS_D fallback
authorNanley Chery <nanley.g.chery@intel.com>
Mon, 1 Jun 2020 15:48:56 +0000 (08:48 -0700)
committerMarge Bot <eric+marge@anholt.net>
Fri, 19 Jun 2020 21:03:31 +0000 (21:03 +0000)
Remove the CCS_D fallback logic so that iris doesn't attempt to use a
non-existent surface state for some renders. Also, add an assertion to
catch the issue.

The fallback in iris_resource_render_aux_usage can lead to this problem
because it doesn't account for the fact that surface states created from
resources with the Y_TILED_CCS modifier may only have CCS_E or NONE as
aux usages (due to iris_resource_create_with_modifiers).

Without this change, the next commit would have triggered the fallback
and regressed the following tests on gen9:

* dEQP-EGL.functional.wide_color.window_888_colorspace_srgb
* dEQP-EGL.functional.wide_color.window_8888_colorspace_srgb
* dEQP-EGL.functional.wide_color.pbuffer_888_colorspace_srgb
* dEQP-EGL.functional.wide_color.pbuffer_8888_colorspace_srgb

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4972>

src/gallium/drivers/iris/iris_resolve.c
src/gallium/drivers/iris/iris_resource.c
src/gallium/drivers/iris/iris_state.c

index 0350e58a22526863498e1f57068b2e1aa14085d7..0d647630f5d91b8c96bf947785b028466ca23c05 100644 (file)
@@ -1019,8 +1019,7 @@ iris_resource_render_aux_usage(struct iris_context *ice,
           format_ccs_e_compat_with_resource(devinfo, res, render_format))
          return ISL_AUX_USAGE_CCS_E;
 
-      /* Otherwise, we try to fall back to CCS_D */
-      if (isl_format_supports_ccs_d(devinfo, render_format))
+      if (res->aux.usage == ISL_AUX_USAGE_CCS_D)
          return ISL_AUX_USAGE_CCS_D;
 
    default:
index 513105d5c2c3be8726d86f1febe01003d04db1a0..232494a9c1fe9134317855621286575ab3f4577b 100644 (file)
@@ -525,8 +525,7 @@ iris_resource_configure_aux(struct iris_screen *screen,
    } else if (has_ccs) {
       if (want_ccs_e_for_format(devinfo, res->surf.format))
          res->aux.possible_usages |= 1 << ISL_AUX_USAGE_CCS_E;
-
-      if (isl_format_supports_ccs_d(devinfo, res->surf.format))
+      else if (isl_format_supports_ccs_d(devinfo, res->surf.format))
          res->aux.possible_usages |= 1 << ISL_AUX_USAGE_CCS_D;
    }
 
index 462a04091beab2babcf5cff3e89c97e0e0bbbe97..9d824507ad8570200f069e6a888d3924177baa00 100644 (file)
@@ -4521,6 +4521,7 @@ surf_state_offset_for_aux(struct iris_resource *res,
                           unsigned aux_modes,
                           enum isl_aux_usage aux_usage)
 {
+   assert(aux_modes & (1 << aux_usage));
    return SURFACE_STATE_ALIGNMENT *
           util_bitcount(aux_modes & ((1 << aux_usage) - 1));
 }