From 4a0a716b6a8c072f9ae16555db17ea8a3d73534c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tapani=20P=C3=A4lli?= Date: Mon, 17 Jun 2024 10:48:05 +0300 Subject: [PATCH] isl: fix condition for enabling sampler route to lsc MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This will disable cases with 2D array views (which could be views to 3D texture) but enables on regular 2D surfaces which seems to work fine. Fixes: 70382f7f065 ("intel/isl/xe2: Enable route of Sampler LD message to LSC") Signed-off-by: Tapani Pälli Reviewed-by: Lionel Landwerlin Reviewed-by: José Roberto de Souza Part-of: --- src/intel/isl/isl_format.c | 6 ------ src/intel/isl/isl_surface_state.c | 6 ++++-- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/src/intel/isl/isl_format.c b/src/intel/isl/isl_format.c index 59f6c551e3b..2ab710d58b7 100644 --- a/src/intel/isl/isl_format.c +++ b/src/intel/isl/isl_format.c @@ -1220,12 +1220,6 @@ isl_format_rgbx_to_rgba(enum isl_format rgbx) bool isl_format_support_sampler_route_to_lsc(enum isl_format fmt) { - /* TODO/FIXME: even only enabling the optimization with formats below this - * is causing some tests to fail so completely disabling this optimization - * for now. - */ - return false; - switch (fmt) { case ISL_FORMAT_R8_UNORM: case ISL_FORMAT_R8G8_UNORM: diff --git a/src/intel/isl/isl_surface_state.c b/src/intel/isl/isl_surface_state.c index 3f5295c84df..4be658090d8 100644 --- a/src/intel/isl/isl_surface_state.c +++ b/src/intel/isl/isl_surface_state.c @@ -579,8 +579,10 @@ isl_genX(surf_fill_state_s)(const struct isl_device *dev, void *state, s.ResourceMinLOD = info->view->min_lod_clamp; #if GFX_VERx10 >= 200 - s.EnableSamplerRoutetoLSC = isl_format_support_sampler_route_to_lsc(info->view->format); - s.EnableSamplerRoutetoLSC &= (s.SurfaceType == SURFTYPE_2D); + s.EnableSamplerRoutetoLSC = + isl_format_support_sampler_route_to_lsc(info->view->format); + s.EnableSamplerRoutetoLSC &= (s.SurfaceType == SURFTYPE_2D && + info->view->array_len == 1); /* Wa_14018471104: * For APIs that use ResourceMinLod, do the following: (remains same as before)