From 26418817a79bf9554fd295cf2f6b4ef5d2026449 Mon Sep 17 00:00:00 2001 From: Kenneth Graunke Date: Mon, 24 Feb 2025 18:37:53 -0800 Subject: [PATCH] isl: Delete redundant "use separate stencil?" check This code, since the dawn of time, has had a redundant check for gen5-6 separate stencil in the final else clause: } else if (doing separate stencil on gen5-6) { return compact } else { if (doing separate stencil on gen5-6) return compact ... } We can eliminate that one. The else clause then has a single if, so it can be folded into the "else if" ladder alongside the others. Reviewed-by: Dylan Baker Reviewed-by: Lionel Landwerlin Part-of: --- src/intel/isl/isl.c | 26 +++++--------------------- 1 file changed, 5 insertions(+), 21 deletions(-) diff --git a/src/intel/isl/isl.c b/src/intel/isl/isl.c index 173aecc40fe..cde768e2abb 100644 --- a/src/intel/isl/isl.c +++ b/src/intel/isl/isl.c @@ -1856,28 +1856,12 @@ isl_choose_array_pitch_span(const struct isl_device *dev, */ assert(info->levels == 1); return ISL_ARRAY_PITCH_SPAN_COMPACT; + } else if (phys_level0_sa->array_len == 1) { + /* The hardware will never use the QPitch. So choose the most + * compact QPitch possible in order to conserve memory. + */ + return ISL_ARRAY_PITCH_SPAN_COMPACT; } else { - if ((ISL_GFX_VER(dev) == 5 || ISL_GFX_VER(dev) == 6) && - ISL_DEV_USE_SEPARATE_STENCIL(dev) && - isl_surf_usage_is_stencil(info->usage)) { - /* [ILK-SNB] Errata from the Sandy Bridge PRM >> Volume 4 Part 1: - * Graphics Core >> Section 7.18.3.7: Surface Arrays: - * - * The separate stencil buffer does not support mip mapping, - * thus the storage for LODs other than LOD 0 is not needed. - */ - assert(info->levels == 1); - assert(phys_level0_sa->array_len == 1); - return ISL_ARRAY_PITCH_SPAN_COMPACT; - } - - if (phys_level0_sa->array_len == 1) { - /* The hardware will never use the QPitch. So choose the most - * compact QPitch possible in order to conserve memory. - */ - return ISL_ARRAY_PITCH_SPAN_COMPACT; - } - return ISL_ARRAY_PITCH_SPAN_FULL; }