drm/i915: Fix missed needs_dmar setting
authorZhenyu Wang <zhenyuw@linux.intel.com>
Thu, 13 Dec 2012 15:47:47 +0000 (23:47 +0800)
committerDaniel Vetter <daniel.vetter@ffwll.ch>
Thu, 13 Dec 2012 20:40:24 +0000 (21:40 +0100)
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.

Signed-off-by: Zhenyu Wang <zhenyuw@linux.intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
drivers/gpu/drm/i915/i915_gem_gtt.c

index f7ac61ee1504dcb9fc493d92ebd20b1f487b4771..2c150dee78a70468f96a87295cd29595cfa46a68 100644 (file)
@@ -639,6 +639,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);