• Ben Widawsky's avatar
    drm/i915: Make semaphore updates more precise · a1444b79
    Ben Widawsky authored
    With the ring mask we now have an easy way to know the number of rings
    in the system, and therefore can accurately predict the number of dwords
    to emit for semaphore signalling. This was not possible (easily)
    previously.
    
    There should be no functional impact, simply fewer instructions emitted.
    
    While we're here, simply do the round up to 2 instead of the fancier
    rounding we did before, which rounding up per mbox, ie 4. This also
    allows us to drop the unnecessary MI_NOOP, so not really 4, 3.
    
    v2: Use 3 dwords instead of 4 (Ville)
    Do the proper calculation to get the number of dwords to emit (Ville)
    Conditionally set .sync_to when semaphores are enabled (Ville)
    
    v3: Rebased on VCS2
    Replace hweight_long with hweight32 (Ville)
    
    v4: Pull out the accidentally squashed hunk from the next patch after
    rebase (Daniel).
    
    v5: Fix conflict after rebase (Rodrigo)
    Reviewed-by: default avatarRodrigo Vivi <rodrigo.vivi@intel.com>
    Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com> (v1)
    Signed-off-by: default avatarBen Widawsky <ben@bwidawsk.net>
    Signed-off-by: default avatarRodrigo Vivi <rodrigo.vivi@intel.com>
    Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
    a1444b79
intel_ringbuffer.c 67.7 KB