From 2f4d21a337f3e69f461f760c9060d68e605272fa Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Thu, 23 Jun 2016 07:24:39 +0100 Subject: [PATCH] drm/i915: More skylake workarounds --- drivers/gpu/drm/i915/i915_gem_gtt.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/i915/i915_gem_gtt.c b/drivers/gpu/drm/i915/i915_gem_gtt.c index a8be1c2..ee51bba 100644 --- a/drivers/gpu/drm/i915/i915_gem_gtt.c +++ b/drivers/gpu/drm/i915/i915_gem_gtt.c @@ -2569,6 +2569,16 @@ static void gen6_gmch_remove(struct i915_address_space *vm) cleanup_scratch(vm); } +static bool need_pte_wa(struct drm_i915_private *dev_priv) +{ +#ifdef CONFIG_INTEL_IOMMU + if (intel_iommu_gfx_mapped && IS_SKYLAKE(dev_priv)) + return true; +#endif + + return false; +} + static int gen8_gmch_probe(struct i915_ggtt *ggtt) { struct drm_i915_private *dev_priv = ggtt_to_i915(ggtt); @@ -2608,7 +2618,7 @@ static int gen8_gmch_probe(struct i915_ggtt *ggtt) ggtt->base.unbind_vma = ggtt_unbind_vma; ggtt->base.insert_page = gen8_ggtt_insert_page; ggtt->base.clear_range = nop_clear_range; - if (!USES_FULL_PPGTT(dev_priv)) + if (!USES_FULL_PPGTT(dev_priv) || need_pte_wa(dev_priv)) ggtt->base.clear_range = gen8_ggtt_clear_range; ggtt->base.insert_entries = gen8_ggtt_insert_entries; -- 1.9.1