Skip to content

Commit

Permalink
drm/i915: Do PCH and uncore init earlier
Browse files Browse the repository at this point in the history
For future platforms we'll need to initialize our MMIO function pointers
even earlier. Specifically, we'll need to be able to have register
reads/writes at GTT initialization (in i915_gem_gtt_init). Similarly,
these platforms also have MMIO differences based on the PCH id, so
while moving stuff around, also move the PCH initialization.

CC: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Ben Widawsky <ben@bwidawsk.net>
[danvet: Mention the function where we need register access.]
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
  • Loading branch information
Ben Widawsky authored and Daniel Vetter committed Oct 10, 2013
1 parent 5ade2c2 commit c3d685a
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions drivers/gpu/drm/i915/i915_dma.c
Original file line number Diff line number Diff line change
Expand Up @@ -1542,6 +1542,11 @@ int i915_driver_load(struct drm_device *dev, unsigned long flags)

intel_uncore_early_sanitize(dev);

/* This must be called before any calls to HAS_PCH_* */
intel_detect_pch(dev);

intel_uncore_init(dev);

ret = i915_gem_gtt_init(dev);
if (ret)
goto out_regs;
Expand Down Expand Up @@ -1599,12 +1604,8 @@ int i915_driver_load(struct drm_device *dev, unsigned long flags)
goto out_mtrrfree;
}

/* This must be called before any calls to HAS_PCH_* */
intel_detect_pch(dev);

intel_irq_init(dev);
intel_pm_init(dev);
intel_uncore_init(dev);
intel_uncore_sanitize(dev);

/* Try to make sure MCHBAR is enabled before poking at it */
Expand Down Expand Up @@ -1689,6 +1690,7 @@ int i915_driver_load(struct drm_device *dev, unsigned long flags)
drm_mm_takedown(&dev_priv->gtt.base.mm);
dev_priv->gtt.base.cleanup(&dev_priv->gtt.base);
out_regs:
intel_uncore_fini(dev);
pci_iounmap(dev->pdev, dev_priv->regs);
put_bridge:
pci_dev_put(dev_priv->bridge_dev);
Expand Down

0 comments on commit c3d685a

Please sign in to comment.