From 33795589ec0ebf20e0a7a2d8c0bacad926e08bc9 Mon Sep 17 00:00:00 2001 From: Nanley Chery Date: Tue, 12 Nov 2024 09:28:40 -0500 Subject: [PATCH] intel/isl: Only set CMF on renderable views on Xe2+ The compression format is only used during rendering. This prevents drivers from hitting an unreachable when we start enabling CCS on linear surfaces which may have non-renderable and non-pow2 formats. For now, continue to use the surface format instead of the view format to look up the CMF. This strategy should return the optimal CMF for compressed surfaces that undergo redescription during copies. Reviewed-by: Jianxun Zhang Part-of: --- src/intel/isl/isl_surface_state.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/intel/isl/isl_surface_state.c b/src/intel/isl/isl_surface_state.c index 1ad7339d452..ef42e84718b 100644 --- a/src/intel/isl/isl_surface_state.c +++ b/src/intel/isl/isl_surface_state.c @@ -753,7 +753,16 @@ isl_genX(surf_fill_state_s)(const struct isl_device *dev, void *state, } } -#if GFX_VERx10 >= 125 +#if GFX_VERx10 >= 200 + /* According to Bspec 58797 (r58646), the compression format is only + * used to improve compression. It is not used for decompression. + */ + if (info->view->usage & (ISL_SURF_USAGE_RENDER_TARGET_BIT | + ISL_SURF_USAGE_STORAGE_BIT)) { + s.CompressionFormat = + isl_get_render_compression_format(info->surf->format); + } +#elif GFX_VERx10 == 125 if (info->aux_usage == ISL_AUX_USAGE_MC) { s.CompressionFormat = get_media_compression_format(info->mc_format, info->surf->format);