From: Nanley Chery Date: Fri, 10 Jul 2020 22:48:36 +0000 (-0700) Subject: iris: Zero the add-on clear color BO on import X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=1f24c54458c64e073c91c4d98049266ac950f840;p=mesa.git iris: Zero the add-on clear color BO on import 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 Part-of: --- diff --git a/src/gallium/drivers/iris/iris_resource.c b/src/gallium/drivers/iris/iris_resource.c index d37f7426583..62888bbacd5 100644 --- a/src/gallium/drivers/iris/iris_resource.c +++ b/src/gallium/drivers/iris/iris_resource.c @@ -782,8 +782,9 @@ iris_resource_finish_aux_import(struct pipe_screen *pscreen, 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; }