diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2011-02-25 22:26:23 +0000 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2011-03-02 09:40:14 +0000 |
commit | 4cbf74ccf8362e99b2bdf1e66112a480c79ecacf (patch) | |
tree | 4420fa9a2626fa080de02fa5566aca4f524b792f /drivers/gpu/drm/i915/i915_dma.c | |
parent | 8d3c3ddfa85837e24fad6fa39318617cbb59e843 (diff) | |
download | blackbird-op-linux-4cbf74ccf8362e99b2bdf1e66112a480c79ecacf.tar.gz blackbird-op-linux-4cbf74ccf8362e99b2bdf1e66112a480c79ecacf.zip |
drm/i915: don't store the reg value for HWS_PGA
It is trivially computable from the real physical address so no need to
store both.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'drivers/gpu/drm/i915/i915_dma.c')
-rw-r--r-- | drivers/gpu/drm/i915/i915_dma.c | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/drivers/gpu/drm/i915/i915_dma.c b/drivers/gpu/drm/i915/i915_dma.c index 8924b4bc7369..72730377a01b 100644 --- a/drivers/gpu/drm/i915/i915_dma.c +++ b/drivers/gpu/drm/i915/i915_dma.c @@ -43,6 +43,17 @@ #include <linux/slab.h> #include <acpi/video.h> +static void i915_write_hws_pga(struct drm_device *dev) +{ + drm_i915_private_t *dev_priv = dev->dev_private; + u32 addr; + + addr = dev_priv->status_page_dmah->busaddr; + if (INTEL_INFO(dev)->gen >= 4) + addr |= (dev_priv->status_page_dmah->busaddr >> 28) & 0xf0; + I915_WRITE(HWS_PGA, addr); +} + /** * Sets up the hardware status page for devices that need a physical address * in the register. @@ -62,15 +73,11 @@ static int i915_init_phys_hws(struct drm_device *dev) } ring->status_page.page_addr = (void __force __iomem *)dev_priv->status_page_dmah->vaddr; - dev_priv->dma_status_page = dev_priv->status_page_dmah->busaddr; memset_io(ring->status_page.page_addr, 0, PAGE_SIZE); - if (INTEL_INFO(dev)->gen >= 4) - dev_priv->dma_status_page |= (dev_priv->dma_status_page >> 28) & - 0xf0; + i915_write_hws_pga(dev); - I915_WRITE(HWS_PGA, dev_priv->dma_status_page); DRM_DEBUG_DRIVER("Enabled hardware status page\n"); return 0; } @@ -217,7 +224,7 @@ static int i915_dma_resume(struct drm_device * dev) if (ring->status_page.gfx_addr != 0) intel_ring_setup_status_page(ring); else - I915_WRITE(HWS_PGA, dev_priv->dma_status_page); + i915_write_hws_pga(dev); DRM_DEBUG_DRIVER("Enabled hardware status page\n"); |