]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
drm/i915: disable sampler indirect state in bindless heap
authorLionel Landwerlin <lionel.g.landwerlin@intel.com>
Fri, 7 Apr 2023 09:32:37 +0000 (12:32 +0300)
committerMatt Roper <matthew.d.roper@intel.com>
Sat, 8 Apr 2023 00:45:05 +0000 (17:45 -0700)
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 <lionel.g.landwerlin@intel.com>
Cc: stable@vger.kernel.org
Reviewed-by: Haridhar Kalvala <haridhar.kalvala@intel.com>
Signed-off-by: Matt Roper <matthew.d.roper@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20230407093237.3296286-1-lionel.g.landwerlin@intel.com
drivers/gpu/drm/i915/gt/intel_gt_regs.h
drivers/gpu/drm/i915/gt/intel_workarounds.c

index 6115cc1805de67f2ad8fecbb29af1ca7e0125ac7..6903c66a4ed72eb2a05953d2a90b3f5469975299 100644 (file)
 #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)
index c0de5276b3d327a1438d4c9965f942e1752d6db5..4e3cbeca9eece64934d0722d6acc4df618cfd8ae 100644 (file)
@@ -3051,6 +3051,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 */