From 5aa4dc7f77ca9f93d5fb3d2f98bf13dee76e2c84 Mon Sep 17 00:00:00 2001 From: Jianxun Zhang Date: Fri, 29 Aug 2025 20:41:42 -0700 Subject: [PATCH] iris: Disable compression on sharing without modifier MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit For an image created either without a modifier to share or as the destination image to get rid of compression by re-allocation, it should have compression disabled. Close: https://gitlab.freedesktop.org/mesa/mesa/-/issues/13729 (Fix firefox misrendering when gfx.wayland.hdr option is true) Backport-to: 25.2 Signed-off-by: Jianxun Zhang Reviewed-by: José Roberto de Souza Reviewed-by: Nanley Chery Part-of: --- src/gallium/drivers/iris/iris_resource.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/gallium/drivers/iris/iris_resource.c b/src/gallium/drivers/iris/iris_resource.c index 78f380a681a..e02c7379331 100644 --- a/src/gallium/drivers/iris/iris_resource.c +++ b/src/gallium/drivers/iris/iris_resource.c @@ -803,6 +803,18 @@ iris_resource_configure_main(const struct iris_screen *screen, if (res->mod_info && !isl_drm_modifier_has_aux(modifier)) usage |= ISL_SURF_USAGE_DISABLE_AUX_BIT; + /* On pre-Xe2 platforms, we still have a chance to disable CCS compression + * in the first query (iris_resource_disable_aux_on_first_query). But that + * function won't work on Xe2+ platforms because the compression state has + * been set in bo's allocation. We have to disable compression since the + * beginning of the image's life cycle in the below case on Xe2, unless a + * complicated bo or VMA manipulation is implemented. That is probably + * unworthy. + */ + else if (screen->devinfo->ver >= 20 && !res->mod_info && + (templ->bind & PIPE_BIND_SHARED)) + usage |= ISL_SURF_USAGE_DISABLE_AUX_BIT; + else if (!res->mod_info && res->external_format != PIPE_FORMAT_NONE) usage |= ISL_SURF_USAGE_DISABLE_AUX_BIT;