Skip to content

Commit 59ec84e

Browse files
committed
drm/i915: Use unchecked uncore writes to flush the GTT
As the GTT is outside of the powerwell, we can simplify flushing the GGTT writes by using an unchecked mmio write and post. v2: s/unc/uncore/ Signed-off-by: Chris Wilson <[email protected]> Reviewed-by: Joonas Lahtinen <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
1 parent 1c8242c commit 59ec84e

File tree

1 file changed

+12
-8
lines changed

1 file changed

+12
-8
lines changed

drivers/gpu/drm/i915/i915_gem_gtt.c

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -108,22 +108,26 @@
108108
static int
109109
i915_get_ggtt_vma_pages(struct i915_vma *vma);
110110

111-
static void gen6_ggtt_invalidate(struct drm_i915_private *dev_priv)
111+
static void gen6_ggtt_invalidate(struct drm_i915_private *i915)
112112
{
113+
struct intel_uncore *uncore = &i915->uncore;
114+
113115
/*
114116
* Note that as an uncached mmio write, this will flush the
115117
* WCB of the writes into the GGTT before it triggers the invalidate.
116118
*/
117-
I915_WRITE(GFX_FLSH_CNTL_GEN6, GFX_FLSH_CNTL_EN);
119+
intel_uncore_write_fw(uncore, GFX_FLSH_CNTL_GEN6, GFX_FLSH_CNTL_EN);
118120
}
119121

120-
static void guc_ggtt_invalidate(struct drm_i915_private *dev_priv)
122+
static void guc_ggtt_invalidate(struct drm_i915_private *i915)
121123
{
122-
gen6_ggtt_invalidate(dev_priv);
123-
I915_WRITE(GEN8_GTCR, GEN8_GTCR_INVALIDATE);
124+
struct intel_uncore *uncore = &i915->uncore;
125+
126+
gen6_ggtt_invalidate(i915);
127+
intel_uncore_write_fw(uncore, GEN8_GTCR, GEN8_GTCR_INVALIDATE);
124128
}
125129

126-
static void gmch_ggtt_invalidate(struct drm_i915_private *dev_priv)
130+
static void gmch_ggtt_invalidate(struct drm_i915_private *i915)
127131
{
128132
intel_gtt_chipset_flush();
129133
}
@@ -1347,10 +1351,10 @@ static void gen8_ppgtt_cleanup_4lvl(struct i915_hw_ppgtt *ppgtt)
13471351

13481352
static void gen8_ppgtt_cleanup(struct i915_address_space *vm)
13491353
{
1350-
struct drm_i915_private *dev_priv = vm->i915;
1354+
struct drm_i915_private *i915 = vm->i915;
13511355
struct i915_hw_ppgtt *ppgtt = i915_vm_to_ppgtt(vm);
13521356

1353-
if (intel_vgpu_active(dev_priv))
1357+
if (intel_vgpu_active(i915))
13541358
gen8_ppgtt_notify_vgt(ppgtt, false);
13551359

13561360
if (i915_vm_is_4lvl(vm))

0 commit comments

Comments
 (0)