When iris imports an I915_FORMAT_MOD_Y_TILED_GEN12_RC_CCS surface, it
allocates a buffer to hold the indirect clear color. When the import is
complete, iris_resource::aux::clear_color is set to zero but the
indirect buffer is filled with garbage values. This could break certain
texture view use-cases, so zero the allocated buffer to fix those.
Fixes: c19492bcdb9 ("iris: Handle importing aux-enabled surfaces on TGL")
Reviewed-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6092>
if (clear_color_state_size > 0) {
res->aux.clear_color_bo =
- iris_bo_alloc(screen->bufmgr, "clear color buffer",
- clear_color_state_size, IRIS_MEMZONE_OTHER);
+ iris_bo_alloc_tiled(screen->bufmgr, "clear color_buffer",
+ clear_color_state_size, 1, IRIS_MEMZONE_OTHER,
+ I915_TILING_NONE, 0, BO_ALLOC_ZEROED);
res->aux.clear_color_offset = 0;
}