• Chris Wilson's avatar
    drm/i915: Introduce for_each_ring() macro · b4519513
    Chris Wilson authored
    
    
    In many places we wish to iterate over the rings associated with the
    GPU, so refactor them to use a common macro.
    
    Along the way, there are a few code removals that should be side-effect
    free and some rearrangement which should only have a cosmetic impact,
    such as error-state.
    
    Note that this slightly changes the semantics in the hangcheck code:
    We now always cycle through all enabled rings instead of
    short-circuiting the logic.
    
    v2: Pull in a couple of suggestions from Ben and Daniel for
    intel_ring_initialized() and not removing the warning (just moving them
    to a new home, closer to the error).
    Signed-off-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
    Reviewed-by: default avatarBen Widawsky <ben@bwidawsk.net>
    [danvet: Added note to commit message about the small behaviour
    change, suggested by Ben Widawsky.]
    Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
    b4519513