From 943fd8152a92fbbb2d17811935f7eeca1f52aa0f Mon Sep 17 00:00:00 2001 From: Nanley Chery Date: Mon, 29 Sep 2025 07:44:02 -0400 Subject: [PATCH] iris: Use the CLEAR state on Xe2+ for MCS On Xe2+, HSD 14011946253 and the related documents explain that MCS still only supports a single clear color. Fixes: df006bba025 ("iris: Update aux state for color fast clears (xe2)") Reviewed-by: Jianxun Zhang Part-of: (cherry picked from commit 6c6b2d8f301a63a9fc7f9fe4884f30093a4778a6) --- .pick_status.json | 2 +- src/gallium/drivers/iris/iris_clear.c | 12 +++++++----- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/.pick_status.json b/.pick_status.json index 5dd3354dad0..cc56793aebe 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -634,7 +634,7 @@ "description": "iris: Use the CLEAR state on Xe2+ for MCS", "nominated": true, "nomination_type": 2, - "resolution": 0, + "resolution": 1, "main_sha": null, "because_sha": "df006bba0256e1d636b3fcc270db7c7b814e61d8", "notes": null diff --git a/src/gallium/drivers/iris/iris_clear.c b/src/gallium/drivers/iris/iris_clear.c index 9d74e10584c..9f27d463cda 100644 --- a/src/gallium/drivers/iris/iris_clear.c +++ b/src/gallium/drivers/iris/iris_clear.c @@ -376,13 +376,15 @@ fast_clear_color(struct iris_context *ice, } } - /* If the buffer is already in ISL_AUX_STATE_CLEAR, the clear is redundant - * and can be skipped. + /* If the clear color is up-to-date and the buffer is already in + * ISL_AUX_STATE_CLEAR, the clear is redundant and can be skipped. */ const enum isl_aux_state aux_state = iris_resource_get_aux_state(res, level, box->z); - if (box->depth == 1 && aux_state == ISL_AUX_STATE_CLEAR) + if ((devinfo->ver < 20 || !color_changed) && + box->depth == 1 && aux_state == ISL_AUX_STATE_CLEAR) { return; + } iris_batch_sync_region_start(batch); @@ -453,8 +455,8 @@ fast_clear_color(struct iris_context *ice, iris_batch_sync_region_end(batch); - iris_resource_set_aux_state(ice, res, level, box->z, - box->depth, devinfo->ver < 20 ? + iris_resource_set_aux_state(ice, res, level, box->z, box->depth, + devinfo->ver < 20 || res->surf.samples > 1 ? ISL_AUX_STATE_CLEAR : ISL_AUX_STATE_COMPRESSED_NO_CLEAR); }