Commit 4cbf74cc authored by Chris Wilson's avatar Chris Wilson

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: default avatarChris Wilson <chris@chris-wilson.co.uk>
parent 8d3c3ddf
...@@ -43,6 +43,17 @@ ...@@ -43,6 +43,17 @@
#include <linux/slab.h> #include <linux/slab.h>
#include <acpi/video.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 * Sets up the hardware status page for devices that need a physical address
* in the register. * in the register.
...@@ -62,15 +73,11 @@ static int i915_init_phys_hws(struct drm_device *dev) ...@@ -62,15 +73,11 @@ static int i915_init_phys_hws(struct drm_device *dev)
} }
ring->status_page.page_addr = ring->status_page.page_addr =
(void __force __iomem *)dev_priv->status_page_dmah->vaddr; (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); memset_io(ring->status_page.page_addr, 0, PAGE_SIZE);
if (INTEL_INFO(dev)->gen >= 4) i915_write_hws_pga(dev);
dev_priv->dma_status_page |= (dev_priv->dma_status_page >> 28) &
0xf0;
I915_WRITE(HWS_PGA, dev_priv->dma_status_page);
DRM_DEBUG_DRIVER("Enabled hardware status page\n"); DRM_DEBUG_DRIVER("Enabled hardware status page\n");
return 0; return 0;
} }
...@@ -217,7 +224,7 @@ static int i915_dma_resume(struct drm_device * dev) ...@@ -217,7 +224,7 @@ static int i915_dma_resume(struct drm_device * dev)
if (ring->status_page.gfx_addr != 0) if (ring->status_page.gfx_addr != 0)
intel_ring_setup_status_page(ring); intel_ring_setup_status_page(ring);
else else
I915_WRITE(HWS_PGA, dev_priv->dma_status_page); i915_write_hws_pga(dev);
DRM_DEBUG_DRIVER("Enabled hardware status page\n"); DRM_DEBUG_DRIVER("Enabled hardware status page\n");
......
...@@ -274,7 +274,6 @@ typedef struct drm_i915_private { ...@@ -274,7 +274,6 @@ typedef struct drm_i915_private {
uint32_t next_seqno; uint32_t next_seqno;
drm_dma_handle_t *status_page_dmah; drm_dma_handle_t *status_page_dmah;
dma_addr_t dma_status_page;
uint32_t counter; uint32_t counter;
drm_local_map_t hws_map; drm_local_map_t hws_map;
struct drm_i915_gem_object *pwrctx; struct drm_i915_gem_object *pwrctx;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment