aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/i915/i915_dma.c
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2013-07-19 15:36:52 -0400
committerDaniel Vetter <daniel.vetter@ffwll.ch>2013-07-25 09:21:50 -0400
commit907b28c56ea40629aa6595ddfa414ec2fc7da41c (patch)
treeb426955ac1e889b5672296399712ff7b1d70662f /drivers/gpu/drm/i915/i915_dma.c
parentcb54b53adae70701bdd77d848cea4b9b39b61cf9 (diff)
drm/i915: Colocate all GT access routines in the same file
Currently, the register access code is split between i915_drv.c and intel_pm.c. It only bares a superficial resemblance to the reset of the powermanagement code, so move it all into its own file. This is to ease further patches to enforce serialised register access. v2: Scan for random abuse of I915_WRITE_NOTRACE v3: Take the opportunity to rename the GT functions as uncore. Uncore is the term used by the hardware design (and bspec) for all functions outside of the GPU (and CPU) cores in what is also known as the System Agent. v4: Rebase onto SNB rc6 fixes Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: Ben Widawsky <ben@bwidawsk.net> [danvet: Wrestle patch into applying and inline intel_uncore_early_sanitize (plus move the old comment to the new function). Also keep the _santize postfix for intel_uncore_sanitize.] [danvet: Squash in fixup spotted by Chris on irc: We need to call intel_pm_init before intel_uncore_sanitize since the later will call cancel_work on the delayed rps setup work the former initializes.] Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Diffstat (limited to 'drivers/gpu/drm/i915/i915_dma.c')
-rw-r--r--drivers/gpu/drm/i915/i915_dma.c25
1 files changed, 5 insertions, 20 deletions
diff --git a/drivers/gpu/drm/i915/i915_dma.c b/drivers/gpu/drm/i915/i915_dma.c
index 1c5b39738508..8536acd0a85d 100644
--- a/drivers/gpu/drm/i915/i915_dma.c
+++ b/drivers/gpu/drm/i915/i915_dma.c
@@ -1436,22 +1436,6 @@ static void i915_dump_device_info(struct drm_i915_private *dev_priv)
1436} 1436}
1437 1437
1438/** 1438/**
1439 * intel_early_sanitize_regs - clean up BIOS state
1440 * @dev: DRM device
1441 *
1442 * This function must be called before we do any I915_READ or I915_WRITE. Its
1443 * purpose is to clean up any state left by the BIOS that may affect us when
1444 * reading and/or writing registers.
1445 */
1446static void intel_early_sanitize_regs(struct drm_device *dev)
1447{
1448 struct drm_i915_private *dev_priv = dev->dev_private;
1449
1450 if (HAS_FPGA_DBG_UNCLAIMED(dev))
1451 I915_WRITE_NOTRACE(FPGA_DBG, FPGA_DBG_RM_NOCLAIM);
1452}
1453
1454/**
1455 * i915_driver_load - setup chip and create an initial config 1439 * i915_driver_load - setup chip and create an initial config
1456 * @dev: DRM device 1440 * @dev: DRM device
1457 * @flags: startup flags 1441 * @flags: startup flags
@@ -1493,7 +1477,7 @@ int i915_driver_load(struct drm_device *dev, unsigned long flags)
1493 spin_lock_init(&dev_priv->irq_lock); 1477 spin_lock_init(&dev_priv->irq_lock);
1494 spin_lock_init(&dev_priv->gpu_error.lock); 1478 spin_lock_init(&dev_priv->gpu_error.lock);
1495 spin_lock_init(&dev_priv->backlight.lock); 1479 spin_lock_init(&dev_priv->backlight.lock);
1496 spin_lock_init(&dev_priv->gt_lock); 1480 spin_lock_init(&dev_priv->uncore.lock);
1497 mutex_init(&dev_priv->dpio_lock); 1481 mutex_init(&dev_priv->dpio_lock);
1498 mutex_init(&dev_priv->rps.hw_lock); 1482 mutex_init(&dev_priv->rps.hw_lock);
1499 mutex_init(&dev_priv->modeset_restore_lock); 1483 mutex_init(&dev_priv->modeset_restore_lock);
@@ -1529,7 +1513,7 @@ int i915_driver_load(struct drm_device *dev, unsigned long flags)
1529 goto put_bridge; 1513 goto put_bridge;
1530 } 1514 }
1531 1515
1532 intel_early_sanitize_regs(dev); 1516 intel_uncore_early_sanitize(dev);
1533 1517
1534 if (IS_HASWELL(dev) && (I915_READ(HSW_EDRAM_PRESENT) == 1)) { 1518 if (IS_HASWELL(dev) && (I915_READ(HSW_EDRAM_PRESENT) == 1)) {
1535 /* The docs do not explain exactly how the calculation can be 1519 /* The docs do not explain exactly how the calculation can be
@@ -1602,8 +1586,9 @@ int i915_driver_load(struct drm_device *dev, unsigned long flags)
1602 intel_detect_pch(dev); 1586 intel_detect_pch(dev);
1603 1587
1604 intel_irq_init(dev); 1588 intel_irq_init(dev);
1605 intel_gt_sanitize(dev); 1589 intel_pm_init(dev);
1606 intel_gt_init(dev); 1590 intel_uncore_sanitize(dev);
1591 intel_uncore_init(dev);
1607 1592
1608 /* Try to make sure MCHBAR is enabled before poking at it */ 1593 /* Try to make sure MCHBAR is enabled before poking at it */
1609 intel_setup_mchbar(dev); 1594 intel_setup_mchbar(dev);