From b8aeca81f9f206806a5ec972ea082ea4a15791a2 Mon Sep 17 00:00:00 2001 From: Yann Argotti Date: Fri, 1 Jul 2016 17:00:21 +0200 Subject: [PATCH] [PATCH] Chris' Patch "drm/i915: More skylake workarounds" rebased vs intel-drm-nightly To: yann.argotti@linux.intel.com Signed-off-by: Yann Argotti --- 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 0bb18b8..c2b1e48 100644 --- a/drivers/gpu/drm/i915/i915_gem_gtt.c +++ b/drivers/gpu/drm/i915/i915_gem_gtt.c @@ -3098,6 +3098,16 @@ static void chv_setup_private_ppat(struct drm_i915_private *dev_priv) I915_WRITE(GEN8_PRIVATE_PAT_HI, pat >> 32); } +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_device *dev = ggtt->base.dev; @@ -3138,7 +3148,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