Skip to contentSkip to conversation

drm/i915: Fix missed needs_dmar setting

PATCH In review Zhenyu Wang 3 participants 3 messages Dec 13, 2012 – Dec 14, 2012

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/i915: Fix missed needs_dmar setting

Quoted 1 line

From Ben's AGP dependence removal change, "needs_dmar" flag has not

been properly setup for new chips using new GTT init function. This one adds missed setting of that flag to make sure we do pci mappings with IOMMU enabled.

---
 drivers/gpu/drm/i915/i915_gem_gtt.c |    4 ++++
 1 file changed, 4 insertions(+)
drivers/gpu/drm/i915/i915_gem_gtt.c +4 -0
index cc1be53..9ae588a 100644
@@ -665,6 +665,10 @@ int i915_gem_gtt_init(struct drm_device *dev)
 	if (!pci_set_dma_mask(dev->pdev, DMA_BIT_MASK(40)))
 		pci_set_consistent_dma_mask(dev->pdev, DMA_BIT_MASK(40));
 
+#ifdef CONFIG_INTEL_IOMMU
+	dev_priv->mm.gtt->needs_dmar = 1;
+#endif
+
 	/* For GEN6+ the PTEs for the ggtt live at 2MB + BAR0 */
 	gtt_bus_addr = pci_resource_start(dev->pdev, 0) + (2<<20);
 	dev_priv->mm.gtt->gma_bus_addr = pci_resource_start(dev->pdev, 2);
Signature · 1 line
1.7.10.4
#1 lore raw
Quoted 6 lines · Zhenyu Wang

From Ben's AGP dependence removal change, "needs_dmar" flag has not been properly setup for new chips using new GTT init function. This one adds missed setting of that flag to make sure we do pci mappings with IOMMU enabled.

Nice catch! Thanks for the patch, merged to -fixes for 3.8. -Daniel

Signature · 3 lines
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch
#2 lore raw
Quoted 10 lines · On Fri, 14 Dec 2012 00:00:07 +0100 Daniel Vetter <[email protected]> wrote:
Quoted 6 lines · Zhenyu Wang

From Ben's AGP dependence removal change, "needs_dmar" flag has not been properly setup for new chips using new GTT init function. This one adds missed setting of that flag to make sure we do pci mappings with IOMMU enabled.

Nice catch! Thanks for the patch, merged to -fixes for 3.8. -Daniel

dmar. can't live with it, can live without it