aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Vetter <daniel.vetter@ffwll.ch>2010-09-24 15:20:10 -0400
committerChris Wilson <chris@chris-wilson.co.uk>2010-09-25 07:23:15 -0400
commit79f321b7e676bd54f563c5ce513588aa90b2cc21 (patch)
tree9ef460994bb367ee35a58ae566926a33ddd5265f
parent3d281d8cca1acb2483444e0d1519c8ab6dda3a47 (diff)
drm/i915: kill ring->get_active_head
All functions are extremely similar, so fold them into one generic implementation. This function isn't used anyway, because there's not yet a bsd ring error state dumper. Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
-rw-r--r--drivers/gpu/drm/i915/intel_ringbuffer.c21
-rw-r--r--drivers/gpu/drm/i915/intel_ringbuffer.h5
2 files changed, 5 insertions, 21 deletions
diff --git a/drivers/gpu/drm/i915/intel_ringbuffer.c b/drivers/gpu/drm/i915/intel_ringbuffer.c
index 487575f2340d..a3e73d4cd391 100644
--- a/drivers/gpu/drm/i915/intel_ringbuffer.c
+++ b/drivers/gpu/drm/i915/intel_ringbuffer.c
@@ -127,8 +127,8 @@ static void ring_set_tail(struct drm_device *dev,
127 I915_WRITE_TAIL(ring, ring->tail); 127 I915_WRITE_TAIL(ring, ring->tail);
128} 128}
129 129
130static unsigned int render_ring_get_active_head(struct drm_device *dev, 130u32 intel_ring_get_active_head(struct drm_device *dev,
131 struct intel_ring_buffer *ring) 131 struct intel_ring_buffer *ring)
132{ 132{
133 drm_i915_private_t *dev_priv = dev->dev_private; 133 drm_i915_private_t *dev_priv = dev->dev_private;
134 u32 acthd_reg = INTEL_INFO(dev)->gen >= 4 ? 134 u32 acthd_reg = INTEL_INFO(dev)->gen >= 4 ?
@@ -376,13 +376,6 @@ bsd_ring_flush(struct drm_device *dev,
376 intel_ring_advance(dev, ring); 376 intel_ring_advance(dev, ring);
377} 377}
378 378
379static unsigned int bsd_ring_get_active_head(struct drm_device *dev,
380 struct intel_ring_buffer *ring)
381{
382 drm_i915_private_t *dev_priv = dev->dev_private;
383 return I915_READ(RING_ACTHD(ring->mmio_base));
384}
385
386static int init_bsd_ring(struct drm_device *dev, 379static int init_bsd_ring(struct drm_device *dev,
387 struct intel_ring_buffer *ring) 380 struct intel_ring_buffer *ring)
388{ 381{
@@ -771,7 +764,6 @@ static const struct intel_ring_buffer render_ring = {
771 .setup_status_page = render_setup_status_page, 764 .setup_status_page = render_setup_status_page,
772 .init = init_render_ring, 765 .init = init_render_ring,
773 .set_tail = ring_set_tail, 766 .set_tail = ring_set_tail,
774 .get_active_head = render_ring_get_active_head,
775 .flush = render_ring_flush, 767 .flush = render_ring_flush,
776 .add_request = render_ring_add_request, 768 .add_request = render_ring_add_request,
777 .get_seqno = render_ring_get_seqno, 769 .get_seqno = render_ring_get_seqno,
@@ -790,7 +782,6 @@ static const struct intel_ring_buffer bsd_ring = {
790 .setup_status_page = bsd_setup_status_page, 782 .setup_status_page = bsd_setup_status_page,
791 .init = init_bsd_ring, 783 .init = init_bsd_ring,
792 .set_tail = ring_set_tail, 784 .set_tail = ring_set_tail,
793 .get_active_head = bsd_ring_get_active_head,
794 .flush = bsd_ring_flush, 785 .flush = bsd_ring_flush,
795 .add_request = bsd_ring_add_request, 786 .add_request = bsd_ring_add_request,
796 .get_seqno = bsd_ring_get_seqno, 787 .get_seqno = bsd_ring_get_seqno,
@@ -831,13 +822,6 @@ static void gen6_bsd_ring_set_tail(struct drm_device *dev,
831 GEN6_BSD_SLEEP_PSMI_CONTROL_RC_ILDL_MESSAGE_ENABLE); 822 GEN6_BSD_SLEEP_PSMI_CONTROL_RC_ILDL_MESSAGE_ENABLE);
832} 823}
833 824
834static unsigned int gen6_bsd_ring_get_active_head(struct drm_device *dev,
835 struct intel_ring_buffer *ring)
836{
837 drm_i915_private_t *dev_priv = dev->dev_private;
838 return I915_READ(RING_ACTHD(ring->mmio_base));
839}
840
841static void gen6_bsd_ring_flush(struct drm_device *dev, 825static void gen6_bsd_ring_flush(struct drm_device *dev,
842 struct intel_ring_buffer *ring, 826 struct intel_ring_buffer *ring,
843 u32 invalidate_domains, 827 u32 invalidate_domains,
@@ -881,7 +865,6 @@ static const struct intel_ring_buffer gen6_bsd_ring = {
881 .setup_status_page = gen6_bsd_setup_status_page, 865 .setup_status_page = gen6_bsd_setup_status_page,
882 .init = init_bsd_ring, 866 .init = init_bsd_ring,
883 .set_tail = gen6_bsd_ring_set_tail, 867 .set_tail = gen6_bsd_ring_set_tail,
884 .get_active_head = gen6_bsd_ring_get_active_head,
885 .flush = gen6_bsd_ring_flush, 868 .flush = gen6_bsd_ring_flush,
886 .add_request = bsd_ring_add_request, 869 .add_request = bsd_ring_add_request,
887 .get_seqno = bsd_ring_get_seqno, 870 .get_seqno = bsd_ring_get_seqno,
diff --git a/drivers/gpu/drm/i915/intel_ringbuffer.h b/drivers/gpu/drm/i915/intel_ringbuffer.h
index d506da1605b4..43c5f7a476fa 100644
--- a/drivers/gpu/drm/i915/intel_ringbuffer.h
+++ b/drivers/gpu/drm/i915/intel_ringbuffer.h
@@ -50,8 +50,6 @@ struct intel_ring_buffer {
50 void (*set_tail)(struct drm_device *dev, 50 void (*set_tail)(struct drm_device *dev,
51 struct intel_ring_buffer *ring, 51 struct intel_ring_buffer *ring,
52 u32 value); 52 u32 value);
53 unsigned int (*get_active_head)(struct drm_device *dev,
54 struct intel_ring_buffer *ring);
55 void (*flush)(struct drm_device *dev, 53 void (*flush)(struct drm_device *dev,
56 struct intel_ring_buffer *ring, 54 struct intel_ring_buffer *ring,
57 u32 invalidate_domains, 55 u32 invalidate_domains,
@@ -128,4 +126,7 @@ u32 intel_ring_get_seqno(struct drm_device *dev,
128int intel_init_render_ring_buffer(struct drm_device *dev); 126int intel_init_render_ring_buffer(struct drm_device *dev);
129int intel_init_bsd_ring_buffer(struct drm_device *dev); 127int intel_init_bsd_ring_buffer(struct drm_device *dev);
130 128
129u32 intel_ring_get_active_head(struct drm_device *dev,
130 struct intel_ring_buffer *ring);
131
131#endif /* _INTEL_RINGBUFFER_H_ */ 132#endif /* _INTEL_RINGBUFFER_H_ */