From e4db19afa72b3dc2a33acc6435f714176adc6df1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tapani=20P=C3=A4lli?= Date: Mon, 31 Jul 2023 10:43:15 +0300 Subject: [PATCH] iris: add data cache flush for pre hiz op MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This fixes various failing Piglit tests on DG2. Cc: mesa-stable Signed-off-by: Tapani Pälli Reviewed-by: Sagar Ghuge Part-of: --- src/gallium/drivers/iris/iris_resolve.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/gallium/drivers/iris/iris_resolve.c b/src/gallium/drivers/iris/iris_resolve.c index 4a202bc7e88..c68c849c2bf 100644 --- a/src/gallium/drivers/iris/iris_resolve.c +++ b/src/gallium/drivers/iris/iris_resolve.c @@ -700,6 +700,13 @@ iris_hiz_exec(struct iris_context *ice, //DBG("%s %s to mt %p level %d layers %d-%d\n", //__func__, name, mt, level, start_layer, start_layer + num_layers - 1); + /* A data cache flush is not suggested by HW docs, but we found it to fix + * a number of failures. + */ + unsigned wa_flush = intel_device_info_is_dg2(batch->screen->devinfo) && + res->aux.usage == ISL_AUX_USAGE_HIZ_CCS ? + PIPE_CONTROL_DATA_CACHE_FLUSH : 0; + /* The following stalls and flushes are only documented to be required * for HiZ clear operations. However, they also seem to be required for * resolve operations. @@ -716,6 +723,7 @@ iris_hiz_exec(struct iris_context *ice, iris_emit_pipe_control_flush(batch, "hiz op: pre-flush", PIPE_CONTROL_DEPTH_CACHE_FLUSH | + wa_flush | PIPE_CONTROL_DEPTH_STALL | PIPE_CONTROL_CS_STALL);