aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorBen Widawsky <ben@bwidawsk.net>2012-11-19 15:23:44 -0500
committerDaniel Vetter <daniel.vetter@ffwll.ch>2012-11-21 11:47:14 -0500
commitb5c621584ba57e6112864dcd79b71020c9525f6a (patch)
tree31f19cd5d5052ae9328b004e28c4833160cb1456 /drivers
parent5774506f157a91400c587b85d1ce4de56f0d32f6 (diff)
drm/i915: Use pci_resource functions for BARs.
This was leftover crap from kill-agp. The current code is theoretically broken for 64b bars. (I resist removing theoretically because I am too lazy to test). We still need to ioremap things ourselves because we want to ioremap_wc the PTEs. v2: Forgot to kill the tmp variable in v1 CC: Chris Wilson <chris@chris-wilson.co.uk> Signed-off-by: Ben Widawsky <ben@bwidawsk.net> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/gpu/drm/i915/i915_gem_gtt.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/drivers/gpu/drm/i915/i915_gem_gtt.c b/drivers/gpu/drm/i915/i915_gem_gtt.c
index 35fec1e61346..51f79bb0b200 100644
--- a/drivers/gpu/drm/i915/i915_gem_gtt.c
+++ b/drivers/gpu/drm/i915/i915_gem_gtt.c
@@ -609,7 +609,6 @@ int i915_gem_gtt_init(struct drm_device *dev)
609 struct drm_i915_private *dev_priv = dev->dev_private; 609 struct drm_i915_private *dev_priv = dev->dev_private;
610 phys_addr_t gtt_bus_addr; 610 phys_addr_t gtt_bus_addr;
611 u16 snb_gmch_ctl; 611 u16 snb_gmch_ctl;
612 u32 tmp;
613 int ret; 612 int ret;
614 613
615 /* On modern platforms we need not worry ourself with the legacy 614 /* On modern platforms we need not worry ourself with the legacy
@@ -638,12 +637,9 @@ int i915_gem_gtt_init(struct drm_device *dev)
638 if (!pci_set_dma_mask(dev->pdev, DMA_BIT_MASK(40))) 637 if (!pci_set_dma_mask(dev->pdev, DMA_BIT_MASK(40)))
639 pci_set_consistent_dma_mask(dev->pdev, DMA_BIT_MASK(40)); 638 pci_set_consistent_dma_mask(dev->pdev, DMA_BIT_MASK(40));
640 639
641 pci_read_config_dword(dev->pdev, PCI_BASE_ADDRESS_0, &tmp);
642 /* For GEN6+ the PTEs for the ggtt live at 2MB + BAR0 */ 640 /* For GEN6+ the PTEs for the ggtt live at 2MB + BAR0 */
643 gtt_bus_addr = (tmp & PCI_BASE_ADDRESS_MEM_MASK) + (2<<20); 641 gtt_bus_addr = pci_resource_start(dev->pdev, 0) + (2<<20);
644 642 dev_priv->mm.gtt->gma_bus_addr = pci_resource_start(dev->pdev, 2);
645 pci_read_config_dword(dev->pdev, PCI_BASE_ADDRESS_2, &tmp);
646 dev_priv->mm.gtt->gma_bus_addr = tmp & PCI_BASE_ADDRESS_MEM_MASK;
647 643
648 /* i9xx_setup */ 644 /* i9xx_setup */
649 pci_read_config_word(dev->pdev, SNB_GMCH_CTRL, &snb_gmch_ctl); 645 pci_read_config_word(dev->pdev, SNB_GMCH_CTRL, &snb_gmch_ctl);