public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
* [PATCH] drm/i915: Disable stolen memory when DMAR is active
@ 2014-02-28 12:14 Chris Wilson
  2014-03-05 15:17 ` Daniel Vetter
  2014-03-18 12:59 ` [PATCH v2 for -fixes] " Jani Nikula
  0 siblings, 2 replies; 15+ messages in thread
From: Chris Wilson @ 2014-02-28 12:14 UTC (permalink / raw)
  To: intel-gfx; +Cc: Daniel Vetter

We have reports of heavy screen corruption if we try to use the stolen
memory reserved by the BIOS whilst the DMA-Remapper is active. This
quirk may be only specific to a few machines or BIOSes, but first lets
apply the big hammer and always disable use of stolen memory when DMAR
is active.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=68535
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
---
 drivers/gpu/drm/i915/i915_gem_stolen.c | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/drivers/gpu/drm/i915/i915_gem_stolen.c b/drivers/gpu/drm/i915/i915_gem_stolen.c
index 984ada1b0084..13a849afe479 100644
--- a/drivers/gpu/drm/i915/i915_gem_stolen.c
+++ b/drivers/gpu/drm/i915/i915_gem_stolen.c
@@ -325,11 +325,25 @@ void i915_gem_cleanup_stolen(struct drm_device *dev)
 	drm_mm_takedown(&dev_priv->mm.stolen);
 }
 
+static bool need_dmar_wa(struct drm_device *dev)
+{
+#ifdef CONFIG_INTEL_IOMMU
+	if (INTEL_INFO(dev)->gen >= 6 && intel_iommu_gfx_mapped)
+		return true;
+#endif
+	return false;
+}
+
 int i915_gem_init_stolen(struct drm_device *dev)
 {
 	struct drm_i915_private *dev_priv = dev->dev_private;
 	struct resource *r;
 
+	if (need_dmar_wa(dev)) {
+		DRM_INFO("DMAR active, disabling use of stolen memory\n");
+		return 0;
+	}
+
 	if (dev_priv->gtt.stolen_size == 0)
 		return 0;
 
-- 
1.9.0

^ permalink raw reply related	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2014-03-20 10:21 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-02-28 12:14 [PATCH] drm/i915: Disable stolen memory when DMAR is active Chris Wilson
2014-03-05 15:17 ` Daniel Vetter
2014-03-05 15:32   ` Chris Wilson
2014-03-05 17:39     ` Daniel Vetter
2014-03-14 13:10       ` Jani Nikula
2014-03-18 12:59 ` [PATCH v2 for -fixes] " Jani Nikula
2014-03-18 16:48   ` Daniel Vetter
2014-03-18 16:50     ` Daniel Vetter
2014-03-19  9:07       ` Jani Nikula
2014-03-19 20:51   ` David Woodhouse
2014-03-20  7:36     ` Jani Nikula
2014-03-20  7:49       ` David Woodhouse
2014-03-20  9:23         ` Jani Nikula
2014-03-20  9:45         ` Daniel Vetter
2014-03-20 10:21           ` David Woodhouse

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox