diff options
Diffstat (limited to 'drivers/gpu/drm/i915/intel_ringbuffer.h')
-rw-r--r-- | drivers/gpu/drm/i915/intel_ringbuffer.h | 30 |
1 files changed, 19 insertions, 11 deletions
diff --git a/drivers/gpu/drm/i915/intel_ringbuffer.h b/drivers/gpu/drm/i915/intel_ringbuffer.h index 5af65b89765f..526182ed0c6d 100644 --- a/drivers/gpu/drm/i915/intel_ringbuffer.h +++ b/drivers/gpu/drm/i915/intel_ringbuffer.h | |||
@@ -1,6 +1,17 @@ | |||
1 | #ifndef _INTEL_RINGBUFFER_H_ | 1 | #ifndef _INTEL_RINGBUFFER_H_ |
2 | #define _INTEL_RINGBUFFER_H_ | 2 | #define _INTEL_RINGBUFFER_H_ |
3 | 3 | ||
4 | /* | ||
5 | * Gen2 BSpec "1. Programming Environment" / 1.4.4.6 "Ring Buffer Use" | ||
6 | * Gen3 BSpec "vol1c Memory Interface Functions" / 2.3.4.5 "Ring Buffer Use" | ||
7 | * Gen4+ BSpec "vol1c Memory Interface and Command Stream" / 5.3.4.5 "Ring Buffer Use" | ||
8 | * | ||
9 | * "If the Ring Buffer Head Pointer and the Tail Pointer are on the same | ||
10 | * cacheline, the Head Pointer must not be greater than the Tail | ||
11 | * Pointer." | ||
12 | */ | ||
13 | #define I915_RING_FREE_SPACE 64 | ||
14 | |||
4 | struct intel_hw_status_page { | 15 | struct intel_hw_status_page { |
5 | u32 *page_addr; | 16 | u32 *page_addr; |
6 | unsigned int gfx_addr; | 17 | unsigned int gfx_addr; |
@@ -70,8 +81,7 @@ struct intel_ring_buffer { | |||
70 | int __must_check (*flush)(struct intel_ring_buffer *ring, | 81 | int __must_check (*flush)(struct intel_ring_buffer *ring, |
71 | u32 invalidate_domains, | 82 | u32 invalidate_domains, |
72 | u32 flush_domains); | 83 | u32 flush_domains); |
73 | int (*add_request)(struct intel_ring_buffer *ring, | 84 | int (*add_request)(struct intel_ring_buffer *ring); |
74 | u32 *seqno); | ||
75 | /* Some chipsets are not quite as coherent as advertised and need | 85 | /* Some chipsets are not quite as coherent as advertised and need |
76 | * an expensive kick to force a true read of the up-to-date seqno. | 86 | * an expensive kick to force a true read of the up-to-date seqno. |
77 | * However, the up-to-date seqno is not always required and the last | 87 | * However, the up-to-date seqno is not always required and the last |
@@ -188,24 +198,16 @@ intel_read_status_page(struct intel_ring_buffer *ring, | |||
188 | 198 | ||
189 | void intel_cleanup_ring_buffer(struct intel_ring_buffer *ring); | 199 | void intel_cleanup_ring_buffer(struct intel_ring_buffer *ring); |
190 | 200 | ||
191 | int __must_check intel_wait_ring_buffer(struct intel_ring_buffer *ring, int n); | ||
192 | static inline int intel_wait_ring_idle(struct intel_ring_buffer *ring) | ||
193 | { | ||
194 | return intel_wait_ring_buffer(ring, ring->size - 8); | ||
195 | } | ||
196 | |||
197 | int __must_check intel_ring_begin(struct intel_ring_buffer *ring, int n); | 201 | int __must_check intel_ring_begin(struct intel_ring_buffer *ring, int n); |
198 | |||
199 | static inline void intel_ring_emit(struct intel_ring_buffer *ring, | 202 | static inline void intel_ring_emit(struct intel_ring_buffer *ring, |
200 | u32 data) | 203 | u32 data) |
201 | { | 204 | { |
202 | iowrite32(data, ring->virtual_start + ring->tail); | 205 | iowrite32(data, ring->virtual_start + ring->tail); |
203 | ring->tail += 4; | 206 | ring->tail += 4; |
204 | } | 207 | } |
205 | |||
206 | void intel_ring_advance(struct intel_ring_buffer *ring); | 208 | void intel_ring_advance(struct intel_ring_buffer *ring); |
209 | int __must_check intel_ring_idle(struct intel_ring_buffer *ring); | ||
207 | 210 | ||
208 | u32 intel_ring_get_seqno(struct intel_ring_buffer *ring); | ||
209 | int intel_ring_flush_all_caches(struct intel_ring_buffer *ring); | 211 | int intel_ring_flush_all_caches(struct intel_ring_buffer *ring); |
210 | int intel_ring_invalidate_all_caches(struct intel_ring_buffer *ring); | 212 | int intel_ring_invalidate_all_caches(struct intel_ring_buffer *ring); |
211 | 213 | ||
@@ -221,6 +223,12 @@ static inline u32 intel_ring_get_tail(struct intel_ring_buffer *ring) | |||
221 | return ring->tail; | 223 | return ring->tail; |
222 | } | 224 | } |
223 | 225 | ||
226 | static inline u32 intel_ring_get_seqno(struct intel_ring_buffer *ring) | ||
227 | { | ||
228 | BUG_ON(ring->outstanding_lazy_request == 0); | ||
229 | return ring->outstanding_lazy_request; | ||
230 | } | ||
231 | |||
224 | static inline void i915_trace_irq_get(struct intel_ring_buffer *ring, u32 seqno) | 232 | static inline void i915_trace_irq_get(struct intel_ring_buffer *ring, u32 seqno) |
225 | { | 233 | { |
226 | if (ring->trace_irq_seqno == 0 && ring->irq_get(ring)) | 234 | if (ring->trace_irq_seqno == 0 && ring->irq_get(ring)) |