Commit 447da187 authored by Daniel Vetter's avatar Daniel Vetter Committed by Chris Wilson

drm/i915: kill ring->setup_status_page

It's the same code, essentially, so kill all copies safe one unified
version.
Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
parent 79f321b7
...@@ -221,7 +221,7 @@ static int i915_dma_resume(struct drm_device * dev) ...@@ -221,7 +221,7 @@ static int i915_dma_resume(struct drm_device * dev)
DRM_DEBUG_DRIVER("hw status page @ %p\n", DRM_DEBUG_DRIVER("hw status page @ %p\n",
ring->status_page.page_addr); ring->status_page.page_addr);
if (ring->status_page.gfx_addr != 0) if (ring->status_page.gfx_addr != 0)
ring->setup_status_page(dev, ring); intel_ring_setup_status_page(dev, ring);
else else
I915_WRITE(HWS_PGA, dev_priv->dma_status_page); I915_WRITE(HWS_PGA, dev_priv->dma_status_page);
......
...@@ -348,8 +348,8 @@ render_ring_put_user_irq(struct drm_device *dev, ...@@ -348,8 +348,8 @@ render_ring_put_user_irq(struct drm_device *dev,
spin_unlock_irqrestore(&dev_priv->user_irq_lock, irqflags); spin_unlock_irqrestore(&dev_priv->user_irq_lock, irqflags);
} }
static void render_setup_status_page(struct drm_device *dev, void intel_ring_setup_status_page(struct drm_device *dev,
struct intel_ring_buffer *ring) struct intel_ring_buffer *ring)
{ {
drm_i915_private_t *dev_priv = dev->dev_private; drm_i915_private_t *dev_priv = dev->dev_private;
if (IS_GEN6(dev)) { if (IS_GEN6(dev)) {
...@@ -404,14 +404,6 @@ bsd_ring_add_request(struct drm_device *dev, ...@@ -404,14 +404,6 @@ bsd_ring_add_request(struct drm_device *dev,
return seqno; return seqno;
} }
static void bsd_setup_status_page(struct drm_device *dev,
struct intel_ring_buffer *ring)
{
drm_i915_private_t *dev_priv = dev->dev_private;
I915_WRITE(RING_HWS_PGA(ring->mmio_base), ring->status_page.gfx_addr);
I915_READ(RING_HWS_PGA(ring->mmio_base));
}
static void static void
bsd_ring_get_user_irq(struct drm_device *dev, bsd_ring_get_user_irq(struct drm_device *dev,
struct intel_ring_buffer *ring) struct intel_ring_buffer *ring)
...@@ -564,7 +556,7 @@ static int init_status_page(struct drm_device *dev, ...@@ -564,7 +556,7 @@ static int init_status_page(struct drm_device *dev,
ring->status_page.obj = obj; ring->status_page.obj = obj;
memset(ring->status_page.page_addr, 0, PAGE_SIZE); memset(ring->status_page.page_addr, 0, PAGE_SIZE);
ring->setup_status_page(dev, ring); intel_ring_setup_status_page(dev, ring);
DRM_DEBUG_DRIVER("%s hws offset: 0x%08x\n", DRM_DEBUG_DRIVER("%s hws offset: 0x%08x\n",
ring->name, ring->status_page.gfx_addr); ring->name, ring->status_page.gfx_addr);
...@@ -761,7 +753,6 @@ static const struct intel_ring_buffer render_ring = { ...@@ -761,7 +753,6 @@ static const struct intel_ring_buffer render_ring = {
.id = RING_RENDER, .id = RING_RENDER,
.mmio_base = RENDER_RING_BASE, .mmio_base = RENDER_RING_BASE,
.size = 32 * PAGE_SIZE, .size = 32 * PAGE_SIZE,
.setup_status_page = render_setup_status_page,
.init = init_render_ring, .init = init_render_ring,
.set_tail = ring_set_tail, .set_tail = ring_set_tail,
.flush = render_ring_flush, .flush = render_ring_flush,
...@@ -779,7 +770,6 @@ static const struct intel_ring_buffer bsd_ring = { ...@@ -779,7 +770,6 @@ static const struct intel_ring_buffer bsd_ring = {
.id = RING_BSD, .id = RING_BSD,
.mmio_base = BSD_RING_BASE, .mmio_base = BSD_RING_BASE,
.size = 32 * PAGE_SIZE, .size = 32 * PAGE_SIZE,
.setup_status_page = bsd_setup_status_page,
.init = init_bsd_ring, .init = init_bsd_ring,
.set_tail = ring_set_tail, .set_tail = ring_set_tail,
.flush = bsd_ring_flush, .flush = bsd_ring_flush,
...@@ -791,14 +781,6 @@ static const struct intel_ring_buffer bsd_ring = { ...@@ -791,14 +781,6 @@ static const struct intel_ring_buffer bsd_ring = {
}; };
static void gen6_bsd_setup_status_page(struct drm_device *dev,
struct intel_ring_buffer *ring)
{
drm_i915_private_t *dev_priv = dev->dev_private;
I915_WRITE(RING_HWS_PGA_GEN6(ring->mmio_base), ring->status_page.gfx_addr);
I915_READ(RING_HWS_PGA_GEN6(ring->mmio_base));
}
static void gen6_bsd_ring_set_tail(struct drm_device *dev, static void gen6_bsd_ring_set_tail(struct drm_device *dev,
struct intel_ring_buffer *ring, struct intel_ring_buffer *ring,
u32 value) u32 value)
...@@ -862,7 +844,6 @@ static const struct intel_ring_buffer gen6_bsd_ring = { ...@@ -862,7 +844,6 @@ static const struct intel_ring_buffer gen6_bsd_ring = {
.id = RING_BSD, .id = RING_BSD,
.mmio_base = GEN6_BSD_RING_BASE, .mmio_base = GEN6_BSD_RING_BASE,
.size = 32 * PAGE_SIZE, .size = 32 * PAGE_SIZE,
.setup_status_page = gen6_bsd_setup_status_page,
.init = init_bsd_ring, .init = init_bsd_ring,
.set_tail = gen6_bsd_ring_set_tail, .set_tail = gen6_bsd_ring_set_tail,
.flush = gen6_bsd_ring_flush, .flush = gen6_bsd_ring_flush,
......
...@@ -41,8 +41,6 @@ struct intel_ring_buffer { ...@@ -41,8 +41,6 @@ struct intel_ring_buffer {
struct intel_ring_buffer *ring); struct intel_ring_buffer *ring);
void (*user_irq_put)(struct drm_device *dev, void (*user_irq_put)(struct drm_device *dev,
struct intel_ring_buffer *ring); struct intel_ring_buffer *ring);
void (*setup_status_page)(struct drm_device *dev,
struct intel_ring_buffer *ring);
int (*init)(struct drm_device *dev, int (*init)(struct drm_device *dev,
struct intel_ring_buffer *ring); struct intel_ring_buffer *ring);
...@@ -128,5 +126,7 @@ int intel_init_bsd_ring_buffer(struct drm_device *dev); ...@@ -128,5 +126,7 @@ int intel_init_bsd_ring_buffer(struct drm_device *dev);
u32 intel_ring_get_active_head(struct drm_device *dev, u32 intel_ring_get_active_head(struct drm_device *dev,
struct intel_ring_buffer *ring); struct intel_ring_buffer *ring);
void intel_ring_setup_status_page(struct drm_device *dev,
struct intel_ring_buffer *ring);
#endif /* _INTEL_RINGBUFFER_H_ */ #endif /* _INTEL_RINGBUFFER_H_ */
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