From 650dc07ec3b0eba8ff21da706d2b1876ada59fc3 Mon Sep 17 00:00:00 2001
From: Daniel Vetter <daniel.vetter@ffwll.ch>
Date: Mon, 2 Apr 2012 10:08:35 +0200
Subject: drm/i915: disable ppgtt on snb when dmar is enabled
Patch-mainline: v3.4-rc2

Totally unexpected that this regressed. Luckily it sounds like we just
need to have dmar disable on the igfx, not the entire system. At least
that's what a few days of testing between Tony Vroon and me indicates.

Reported-by: Tony Vroon <tony@linx.net>
Cc: Tony Vroon <tony@linx.net>
Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=43024
Acked-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-Off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Acked-by: Michal Srb <msrb@suse.com>

Automatically created from "patches.drm/1166-drm-i915-disable-ppgtt-on-snb-when-dmar-is-enabled" by xen-port-patches.py

--- sle11sp3.orig/drivers/gpu/drm/i915/i915_gem.c	2013-08-28 13:13:07.000000000 +0200
+++ sle11sp3/drivers/gpu/drm/i915/i915_gem.c	2013-12-16 12:48:54.000000000 +0100
@@ -4000,7 +4000,7 @@ intel_enable_ppgtt(struct drm_device *de
 	if (i915_enable_ppgtt >= 0)
 		return i915_enable_ppgtt;
 
-#ifdef CONFIG_DMAR
+#if defined(CONFIG_DMAR) || defined(CONFIG_XEN)
 	/* Disable ppgtt on SNB if VT-d is on. */
 	if (INTEL_INFO(dev)->gen == 6 && intel_iommu_gfx_mapped)
 		return false;
--- sle11sp3.orig/include/drm/intel-gtt.h	2013-12-16 12:40:34.000000000 +0100
+++ sle11sp3/include/drm/intel-gtt.h	2013-04-03 10:41:37.000000000 +0200
@@ -45,6 +45,8 @@ void intel_gtt_clear_range(unsigned int 
 
 #ifdef CONFIG_DMAR
 extern int intel_iommu_gfx_mapped;
+#elif defined(CONFIG_XEN)
+#define intel_iommu_gfx_mapped 1
 #endif
 
 #endif
