Skip to content

Commit

Permalink
drm/i915/execlists: Shortcircuit queue_prio() for no internal levels
Browse files Browse the repository at this point in the history
If there are no internal levels and the user priority-shift is zero, we
can help the compiler eliminate some dead code:

Function                                     old     new   delta
start_timeslice                              169     154     -15
__execlists_submission_tasklet              4696    4659     -37

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Mika Kuoppala <mika.kuoppala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200525075347.582-4-chris@chris-wilson.co.uk
  • Loading branch information
Chris Wilson committed May 26, 2020
1 parent 7c4541a commit 9ae6c4e
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions drivers/gpu/drm/i915/gt/intel_lrc.c
Original file line number Diff line number Diff line change
Expand Up @@ -446,6 +446,9 @@ static int queue_prio(const struct intel_engine_execlists *execlists)
* we have to flip the index value to become priority.
*/
p = to_priolist(rb);
if (!I915_USER_PRIORITY_SHIFT)
return p->priority;

return ((p->priority + 1) << I915_USER_PRIORITY_SHIFT) - ffs(p->used);
}

Expand Down

0 comments on commit 9ae6c4e

Please sign in to comment.