From: Chris Wilson Date: Sun, 10 Feb 2013 19:38:13 +0000 (+0000) Subject: drm/i915: Read the Base of Stolen Memory for 915gm X-Git-Tag: next-20130220~64^2~38 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=0e91d24baab4a28bcb1293b218c354b1b12c3821;p=karo-tx-linux.git drm/i915: Read the Base of Stolen Memory for 915gm Reading the cspec pays dividends once again, as I found the 'Base of Stolen Memory' config register so that we can skip the fragile computation from Top of Usable Draw and use the real value provided by the BIOS. Signed-off-by: Chris Wilson Acked-by: Ben Widawsky Signed-off-by: Daniel Vetter --- diff --git a/drivers/gpu/drm/i915/i915_gem_stolen.c b/drivers/gpu/drm/i915/i915_gem_stolen.c index 69d97cbac13c..9f01332198de 100644 --- a/drivers/gpu/drm/i915/i915_gem_stolen.c +++ b/drivers/gpu/drm/i915/i915_gem_stolen.c @@ -72,13 +72,10 @@ static unsigned long i915_stolen_to_physical(struct drm_device *dev) } else if (INTEL_INFO(dev)->gen > 3 || IS_G33(dev)) { /* Read Graphics Base of Stolen Memory directly */ pci_read_config_dword(pdev, 0xA4, &base); -#if 0 } else if (IS_GEN3(dev)) { - u8 val; - /* Stolen is immediately below Top of Low Usable DRAM */ - pci_read_config_byte(pdev, 0x9c, &val); - base = val >> 3 << 27; - base -= dev_priv->mm.gtt->stolen_size; + /* Read D2:F0 Base of Stolen Memory directly */ + pci_read_config_dword(dev->pdev, 0x5c, &base); +#if 0 } else { /* Stolen is immediately above Top of Memory */ base = max_low_pfn_mapped << PAGE_SHIFT;