From 2336058bbbfeac33265f93ca9cd44971479fdc10 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tapani=20P=C3=A4lli?= Date: Mon, 11 Dec 2023 10:13:28 +0200 Subject: [PATCH] iris: use slow clear for small surfaces with Wa_18020603990 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Described in Wa_18020603990, we need to use slow clear or add an partial resolve after fast clear for surfaces where bpp <= 32 and dim <= 256x256. Signed-off-by: Tapani Pälli Reviewed-by: Nanley Chery Part-of: --- src/gallium/drivers/iris/iris_clear.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/gallium/drivers/iris/iris_clear.c b/src/gallium/drivers/iris/iris_clear.c index 59e8adb8a0b..ecb52fc9d08 100644 --- a/src/gallium/drivers/iris/iris_clear.c +++ b/src/gallium/drivers/iris/iris_clear.c @@ -138,6 +138,16 @@ can_fast_clear_color(struct iris_context *ice, return false; } + /* Wa_18020603990 - slow clear surfaces up to 256x256, 32bpp. */ + const struct intel_device_info *devinfo = + ((struct iris_screen *)ice->ctx.screen)->devinfo; + if (intel_needs_workaround(devinfo, 18020603990)) { + if (isl_format_get_layout(res->surf.format)->bpb <= 32 && + res->surf.logical_level0_px.w <= 256 && + res->surf.logical_level0_px.h <= 256) + return false; + } + return true; }