@@ -608,9 +608,9 @@ static bool intel_gtt_can_wc(void)
static int intel_gtt_init(void)
{
- u32 gma_addr;
+ struct pci_bus_region r;
u32 gtt_map_size;
- int ret;
+ int ret, idx;
ret = intel_private.driver->setup();
if (ret != 0)
@@ -660,13 +660,14 @@ static int intel_gtt_init(void)
}
if (INTEL_GTT_GEN <= 2)
- pci_read_config_dword(intel_private.pcidev, I810_GMADDR,
- &gma_addr);
+ idx = 0; /* I810_GMADDR */
else
- pci_read_config_dword(intel_private.pcidev, I915_GMADDR,
- &gma_addr);
+ idx = 2; /* I915_GMADDR */
+
+ pcibios_resource_to_bus(intel_private.pcidev->bus, &r,
+ &intel_private.pcidev->resource[idx]);
- intel_private.gma_bus_addr = (gma_addr & PCI_BASE_ADDRESS_MEM_MASK);
+ intel_private.gma_bus_addr = r.start;
return 0;
}