From 7643403c1ba7f50581da94ae35545b5dc6fdf0f1 Mon Sep 17 00:00:00 2001 From: Jiri Slaby Date: May 17 2023 19:16:02 +0000 Subject: drm/i915: disable sampler indirect state in bindless heap (bsc#1012628). --- diff --git a/patches.kernel.org/6.3.3-219-drm-i915-disable-sampler-indirect-state-in-bind.patch b/patches.kernel.org/6.3.3-219-drm-i915-disable-sampler-indirect-state-in-bind.patch new file mode 100644 index 0000000..5b52e81 --- /dev/null +++ b/patches.kernel.org/6.3.3-219-drm-i915-disable-sampler-indirect-state-in-bind.patch @@ -0,0 +1,82 @@ +From: Lionel Landwerlin +Date: Fri, 7 Apr 2023 12:32:37 +0300 +Subject: [PATCH] drm/i915: disable sampler indirect state in bindless heap +References: bsc#1012628 +Patch-mainline: 6.3.3 +Git-commit: 81900e3a37750d8c6ad705045310e002f6dd0356 + +[ Upstream commit 81900e3a37750d8c6ad705045310e002f6dd0356 ] + +By default the indirect state sampler data (border colors) are stored +in the same heap as the SAMPLER_STATE structure. For userspace drivers +that can be 2 different heaps (dynamic state heap & bindless sampler +state heap). This means that border colors have to copied in 2 +different places so that the same SAMPLER_STATE structure find the +right data. + +This change is forcing the indirect state sampler data to only be in +the dynamic state pool (more convenient for userspace drivers, they +only have to have one copy of the border colors). This is reproducing +the behavior of the Windows drivers. + +BSpec: 46052 + +Signed-off-by: Lionel Landwerlin +Cc: stable@vger.kernel.org +Reviewed-by: Haridhar Kalvala +Signed-off-by: Matt Roper +Link: https://patchwork.freedesktop.org/patch/msgid/20230407093237.3296286-1-lionel.g.landwerlin@intel.com +(cherry picked from commit 16fc9c08f0ec7b1c95f1ea4a16097acdb3fc943d) +Signed-off-by: Joonas Lahtinen +Signed-off-by: Sasha Levin +Signed-off-by: Jiri Slaby +--- + drivers/gpu/drm/i915/gt/intel_gt_regs.h | 1 + + drivers/gpu/drm/i915/gt/intel_workarounds.c | 19 +++++++++++++++++++ + 2 files changed, 20 insertions(+) + +diff --git a/drivers/gpu/drm/i915/gt/intel_gt_regs.h b/drivers/gpu/drm/i915/gt/intel_gt_regs.h +index 72275749..e54891b0 100644 +--- a/drivers/gpu/drm/i915/gt/intel_gt_regs.h ++++ b/drivers/gpu/drm/i915/gt/intel_gt_regs.h +@@ -1146,6 +1146,7 @@ + #define SC_DISABLE_POWER_OPTIMIZATION_EBB REG_BIT(9) + #define GEN11_SAMPLER_ENABLE_HEADLESS_MSG REG_BIT(5) + #define MTL_DISABLE_SAMPLER_SC_OOO REG_BIT(3) ++#define GEN11_INDIRECT_STATE_BASE_ADDR_OVERRIDE REG_BIT(0) + + #define GEN9_HALF_SLICE_CHICKEN7 MCR_REG(0xe194) + #define DG2_DISABLE_ROUND_ENABLE_ALLOW_FOR_SSLA REG_BIT(15) +diff --git a/drivers/gpu/drm/i915/gt/intel_workarounds.c b/drivers/gpu/drm/i915/gt/intel_workarounds.c +index b7c6c078..14f92a80 100644 +--- a/drivers/gpu/drm/i915/gt/intel_workarounds.c ++++ b/drivers/gpu/drm/i915/gt/intel_workarounds.c +@@ -3015,6 +3015,25 @@ general_render_compute_wa_init(struct intel_engine_cs *engine, struct i915_wa_li + + add_render_compute_tuning_settings(i915, wal); + ++ if (GRAPHICS_VER(i915) >= 11) { ++ /* This is not a Wa (although referred to as ++ * WaSetInidrectStateOverride in places), this allows ++ * applications that reference sampler states through ++ * the BindlessSamplerStateBaseAddress to have their ++ * border color relative to DynamicStateBaseAddress ++ * rather than BindlessSamplerStateBaseAddress. ++ * ++ * Otherwise SAMPLER_STATE border colors have to be ++ * copied in multiple heaps (DynamicStateBaseAddress & ++ * BindlessSamplerStateBaseAddress) ++ * ++ * BSpec: 46052 ++ */ ++ wa_mcr_masked_en(wal, ++ GEN10_SAMPLER_MODE, ++ GEN11_INDIRECT_STATE_BASE_ADDR_OVERRIDE); ++ } ++ + if (IS_MTL_GRAPHICS_STEP(i915, M, STEP_B0, STEP_FOREVER) || + IS_MTL_GRAPHICS_STEP(i915, P, STEP_B0, STEP_FOREVER)) + /* Wa_14017856879 */ +-- +2.35.3 + diff --git a/series.conf b/series.conf index 9d8509d..c09a6e2 100644 --- a/series.conf +++ b/series.conf @@ -952,6 +952,7 @@ patches.kernel.org/6.3.3-216-drm-i915-Add-_PICK_EVEN_2RANGES.patch patches.kernel.org/6.3.3-217-drm-i915-mtl-Add-workarounds-Wa_14017066071-and.patch patches.kernel.org/6.3.3-218-drm-i915-mtl-Add-Wa_14017856879.patch + patches.kernel.org/6.3.3-219-drm-i915-disable-sampler-indirect-state-in-bind.patch ######################################################## # Build fixes that apply to the vanilla kernel too.