[Intel-gfx] [PATCH] drm/i915: clean up ring id/semaphore sync index magic

Chris Wilson chris at chris-wilson.co.uk
Thu Sep 15 11:33:18 CEST 2011


On Thu, 15 Sep 2011 10:13:36 +0200, Daniel Vetter <daniel.vetter at ffwll.ch> wrote:
> The calculation of the semaphore sync register index is obfuscated
> by some pointer calculation to get at the ring id (RCS, VCS and BCS).
> Now we already have a ring->id field, but that contains a flag value
> usefull for ORing together multiple rings - that's what the flushing
> code as the user of this field needs.
> 
> So change the meaning of ring->id to be the real id, add a tiny
> helper for those that actually want a flag and use ring->id in the
> semaphore index calculations.
> 
> Also extract the inverse function intel_sync_index_to_ring_id and
> move it right next to intel_ring_sync_index.
> 
> v2: Simplify RING_SYNC macro as suggested by Chris Wilson.
> 
> Signed-off-by: Daniel Vetter <daniel.vetter at ffwll.ch>

I do like the cleanup of the naming scheme for the rings, and it is a
good incremental improvement to the innards of the semaphore code.

Reviewed-by: Chris Wilson <chris at chris-wilson.co.uk>

Ben, can you use this a base for further improvements?
-Chris

-- 
Chris Wilson, Intel Open Source Technology Centre



More information about the Intel-gfx mailing list