On Thu, Jan 17, 2013 at 12:45:18PM -0800, Ben Widawsky wrote: > Similar to gtt_mappable_entries we don't usually want the entries, > it's easy enough to calculate it when you need. > > v2: Move relevant fields above pre-gen6 init > > Reviewed-by: Rodrigo Vivi <rodrigo.vivi at gmail.com> > Signed-off-by: Ben Widawsky <ben at bwidawsk.net> [snip] > @@ -687,11 +690,18 @@ int i915_gem_gtt_init(struct drm_device *dev) > { > struct drm_i915_private *dev_priv = dev->dev_private; > phys_addr_t gtt_bus_addr; > + u32 gtt_size; > u16 snb_gmch_ctl; > int ret; > > + if (!pci_set_dma_mask(dev->pdev, DMA_BIT_MASK(40))) > + pci_set_consistent_dma_mask(dev->pdev, DMA_BIT_MASK(40)); > + > + pci_read_config_word(dev->pdev, SNB_GMCH_CTRL, &snb_gmch_ctl); > dev_priv->gtt.mappable_base = pci_resource_start(dev->pdev, 2); > dev_priv->gtt.mappable_end = pci_resource_len(dev->pdev, 2); > + gtt_size = gen6_get_total_gtt_size(snb_gmch_ctl); Calculating gtt size like this doesn't work too well on pre-gen6. -Daniel -- Daniel Vetter Software Engineer, Intel Corporation +41 (0) 79 365 57 48 - http://blog.ffwll.ch