From 6778b3a379d010d9b4d82e7324bff19d73cd3d1a Mon Sep 17 00:00:00 2001 From: Nanley Chery Date: Mon, 27 Dec 2021 10:15:19 -0500 Subject: [PATCH] iris: Don't fast clear with the view format Fast clear with the resource format instead. This is safe to do because can_fast_clear_color ensures that the clear color generates the same pixel with either the view format or the resource format. On SKL, this prevents us from using an invalid surface state. This platform doesn't support CCS_E with sRGB formats, but prior to this patch we allowed fast-clearing with this combination. Piglit's fcc-write-after-clear test can trigger this. Fixes: 230952c2101 ("iris: Don't support sRGB + Y_TILED_CCS on gen9") Reviewed-by: Kenneth Graunke Part-of: --- src/gallium/drivers/iris/iris_clear.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/gallium/drivers/iris/iris_clear.c b/src/gallium/drivers/iris/iris_clear.c index 71385bce447..e599e0dc54b 100644 --- a/src/gallium/drivers/iris/iris_clear.c +++ b/src/gallium/drivers/iris/iris_clear.c @@ -280,7 +280,8 @@ fast_clear_color(struct iris_context *ice, iris_blorp_surf_for_resource(&batch->screen->isl_dev, &surf, p_res, res->aux.usage, level, true); - blorp_fast_clear(&blorp_batch, &surf, format, ISL_SWIZZLE_IDENTITY, + blorp_fast_clear(&blorp_batch, &surf, res->surf.format, + ISL_SWIZZLE_IDENTITY, level, box->z, box->depth, box->x, box->y, box->x + box->width, box->y + box->height);