aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/i915/i915_dma.c
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2011-02-25 17:26:23 -0500
committerChris Wilson <chris@chris-wilson.co.uk>2011-03-02 04:40:14 -0500
commit4cbf74ccf8362e99b2bdf1e66112a480c79ecacf (patch)
tree4420fa9a2626fa080de02fa5566aca4f524b792f /drivers/gpu/drm/i915/i915_dma.c
parent8d3c3ddfa85837e24fad6fa39318617cbb59e843 (diff)
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.c19
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 @@
43#include <linux/slab.h> 43#include <linux/slab.h>
44#include <acpi/video.h> 44#include <acpi/video.h>
45 45
46static void i915_write_hws_pga(struct drm_device *dev)
47{
48 drm_i915_private_t *dev_priv = dev->dev_private;
49 u32 addr;
50
51 addr = dev_priv->status_page_dmah->busaddr;
52 if (INTEL_INFO(dev)->gen >= 4)
53 addr |= (dev_priv->status_page_dmah->busaddr >> 28) & 0xf0;
54 I915_WRITE(HWS_PGA, addr);
55}
56
46/** 57/**
47 * Sets up the hardware status page for devices that need a physical address 58 * Sets up the hardware status page for devices that need a physical address
48 * in the register. 59 * in the register.
@@ -62,15 +73,11 @@ static int i915_init_phys_hws(struct drm_device *dev)
62 } 73 }
63 ring->status_page.page_addr = 74 ring->status_page.page_addr =
64 (void __force __iomem *)dev_priv->status_page_dmah->vaddr; 75 (void __force __iomem *)dev_priv->status_page_dmah->vaddr;
65 dev_priv->dma_status_page = dev_priv->status_page_dmah->busaddr;
66 76
67 memset_io(ring->status_page.page_addr, 0, PAGE_SIZE); 77 memset_io(ring->status_page.page_addr, 0, PAGE_SIZE);
68 78
69 if (INTEL_INFO(dev)->gen >= 4) 79 i915_write_hws_pga(dev);
70 dev_priv->dma_status_page |= (dev_priv->dma_status_page >> 28) &
71 0xf0;
72 80
73 I915_WRITE(HWS_PGA, dev_priv->dma_status_page);
74 DRM_DEBUG_DRIVER("Enabled hardware status page\n"); 81 DRM_DEBUG_DRIVER("Enabled hardware status page\n");
75 return 0; 82 return 0;
76} 83}
@@ -217,7 +224,7 @@ static int i915_dma_resume(struct drm_device * dev)
217 if (ring->status_page.gfx_addr != 0) 224 if (ring->status_page.gfx_addr != 0)
218 intel_ring_setup_status_page(ring); 225 intel_ring_setup_status_page(ring);
219 else 226 else
220 I915_WRITE(HWS_PGA, dev_priv->dma_status_page); 227 i915_write_hws_pga(dev);
221 228
222 DRM_DEBUG_DRIVER("Enabled hardware status page\n"); 229 DRM_DEBUG_DRIVER("Enabled hardware status page\n");
223 230