diff options
author | Ben Widawsky <ben@bwidawsk.net> | 2011-03-19 21:14:27 -0400 |
---|---|---|
committer | Keith Packard <keithp@keithp.com> | 2011-05-10 16:56:40 -0400 |
commit | 96f298aa9c9fc9b7c8a2ebaf8c195d178f570e09 (patch) | |
tree | cfb71da9613d701728520ec5f916e7cb6aa8a889 /drivers/gpu/drm/i915/intel_ringbuffer.h | |
parent | 2c34b850ee1e9f86b41706149d0954eee58757a3 (diff) |
drm/1915: ringbuffer wait for idle function
Added a new function which waits for the ringbuffer space to be equal to
(total - 8). This is the empty condition of the ringbuffer, and
equivalent to head==tail.
Also modified two users of this functionality elsewhere in the code.
Signed-off-by: Ben Widawsky <ben@bwidawsk.net>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'drivers/gpu/drm/i915/intel_ringbuffer.h')
-rw-r--r-- | drivers/gpu/drm/i915/intel_ringbuffer.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/gpu/drm/i915/intel_ringbuffer.h b/drivers/gpu/drm/i915/intel_ringbuffer.h index f23cc5f037a6..16cb125eb117 100644 --- a/drivers/gpu/drm/i915/intel_ringbuffer.h +++ b/drivers/gpu/drm/i915/intel_ringbuffer.h | |||
@@ -164,7 +164,13 @@ intel_read_status_page(struct intel_ring_buffer *ring, | |||
164 | #define I915_BREADCRUMB_INDEX 0x21 | 164 | #define I915_BREADCRUMB_INDEX 0x21 |
165 | 165 | ||
166 | void intel_cleanup_ring_buffer(struct intel_ring_buffer *ring); | 166 | void intel_cleanup_ring_buffer(struct intel_ring_buffer *ring); |
167 | |||
167 | int __must_check intel_wait_ring_buffer(struct intel_ring_buffer *ring, int n); | 168 | int __must_check intel_wait_ring_buffer(struct intel_ring_buffer *ring, int n); |
169 | static inline int intel_wait_ring_idle(struct intel_ring_buffer *ring) | ||
170 | { | ||
171 | return intel_wait_ring_buffer(ring, ring->space - 8); | ||
172 | } | ||
173 | |||
168 | int __must_check intel_ring_begin(struct intel_ring_buffer *ring, int n); | 174 | int __must_check intel_ring_begin(struct intel_ring_buffer *ring, int n); |
169 | 175 | ||
170 | static inline void intel_ring_emit(struct intel_ring_buffer *ring, | 176 | static inline void intel_ring_emit(struct intel_ring_buffer *ring, |