diff options
author | Ben Widawsky <ben@bwidawsk.net> | 2011-09-14 23:32:47 -0400 |
---|---|---|
committer | Keith Packard <keithp@keithp.com> | 2011-09-21 17:52:41 -0400 |
commit | c8c99b0f0dea1ced5d0e10cdb9143356cc16b484 (patch) | |
tree | c7a124662da83f054bc9fb6a60735f528d8d6d30 /drivers/gpu/drm/i915/intel_ringbuffer.h | |
parent | e0dac65ed45e72fe34cc7ccc76de0ba220bd38bb (diff) |
drm/i915: Dumb down the semaphore logic
While I think the previous code is correct, it was hard to follow and
hard to debug. Since we already have a ring abstraction, might as well
use it to handle the semaphore updates and compares.
I don't expect this code to make semaphores better or worse, but you
never know...
v2:
Remove magic per Keith's suggestions.
Ran Daniel's gem_ring_sync_loop test on this.
v3:
Ignored one of Keith's suggestions.
v4:
Removed some bloat per Daniel's recommendation.
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Cc: Keith Packard <keithp@keithp.com>
Signed-off-by: Ben Widawsky <ben@bwidawsk.net>
Signed-off-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'drivers/gpu/drm/i915/intel_ringbuffer.h')
-rw-r--r-- | drivers/gpu/drm/i915/intel_ringbuffer.h | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/drivers/gpu/drm/i915/intel_ringbuffer.h b/drivers/gpu/drm/i915/intel_ringbuffer.h index 600e67abd8d0..68281c96c558 100644 --- a/drivers/gpu/drm/i915/intel_ringbuffer.h +++ b/drivers/gpu/drm/i915/intel_ringbuffer.h | |||
@@ -75,7 +75,12 @@ struct intel_ring_buffer { | |||
75 | int (*dispatch_execbuffer)(struct intel_ring_buffer *ring, | 75 | int (*dispatch_execbuffer)(struct intel_ring_buffer *ring, |
76 | u32 offset, u32 length); | 76 | u32 offset, u32 length); |
77 | void (*cleanup)(struct intel_ring_buffer *ring); | 77 | void (*cleanup)(struct intel_ring_buffer *ring); |
78 | int (*sync_to)(struct intel_ring_buffer *ring, | ||
79 | struct intel_ring_buffer *to, | ||
80 | u32 seqno); | ||
78 | 81 | ||
82 | u32 semaphore_register[3]; /*our mbox written by others */ | ||
83 | u32 signal_mbox[2]; /* mboxes this ring signals to */ | ||
79 | /** | 84 | /** |
80 | * List of objects currently involved in rendering from the | 85 | * List of objects currently involved in rendering from the |
81 | * ringbuffer. | 86 | * ringbuffer. |
@@ -180,9 +185,6 @@ static inline void intel_ring_emit(struct intel_ring_buffer *ring, | |||
180 | void intel_ring_advance(struct intel_ring_buffer *ring); | 185 | void intel_ring_advance(struct intel_ring_buffer *ring); |
181 | 186 | ||
182 | u32 intel_ring_get_seqno(struct intel_ring_buffer *ring); | 187 | u32 intel_ring_get_seqno(struct intel_ring_buffer *ring); |
183 | int intel_ring_sync(struct intel_ring_buffer *ring, | ||
184 | struct intel_ring_buffer *to, | ||
185 | u32 seqno); | ||
186 | 188 | ||
187 | int intel_init_render_ring_buffer(struct drm_device *dev); | 189 | int intel_init_render_ring_buffer(struct drm_device *dev); |
188 | int intel_init_bsd_ring_buffer(struct drm_device *dev); | 190 | int intel_init_bsd_ring_buffer(struct drm_device *dev); |