isl: make Wa_1806565034 conditional to non robust access
authorLionel Landwerlin <lionel.g.landwerlin@intel.com>
Mon, 12 Dec 2022 13:30:40 +0000 (15:30 +0200)
committerMarge Bot <emma+marge@anholt.net>
Tue, 13 Dec 2022 18:05:19 +0000 (18:05 +0000)
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Ivan Briano <ivan.briano@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20280>

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

index 7a35605..f3abbd5 100644 (file)
@@ -1707,6 +1707,13 @@ struct isl_surf_fill_state_info {
 
    /* Intra-tile offset */
    uint16_t x_offset_sa, y_offset_sa;
+
+   /**
+    * Robust image access enabled
+    *
+    * This is used to turn off a performance workaround.
+    */
+   bool robust_image_access;
 };
 
 struct isl_buffer_fill_state_info {
index 139c196..59158f8 100644 (file)
@@ -362,9 +362,16 @@ isl_genX(surf_fill_state_s)(const struct isl_device *dev, void *state,
    }
 
 #if GFX_VER >= 12
-   /* Wa_1806565034: Only set SurfaceArray if arrayed surface is > 1. */
+   /* Wa_1806565034:
+    *
+    *    "Only set SurfaceArray if arrayed surface is > 1."
+    *
+    * Since this is a performance workaround, we only enable it when robust
+    * image access is disabled. Otherwise layered robust access is not
+    * specification compliant.
+    */
    s.SurfaceArray = info->surf->dim != ISL_SURF_DIM_3D &&
-      info->view->array_len > 1;
+      (info->robust_image_access || info->view->array_len > 1);
 #elif GFX_VER >= 7
    s.SurfaceArray = info->surf->dim != ISL_SURF_DIM_3D;
 #endif