• Chris Wilson's avatar
    drm/i915/scheduler: Execute requests in order of priorities · 20311bd3
    Chris Wilson authored
    Track the priority of each request and use it to determine the order in
    which we submit requests to the hardware via execlists.
    
    The priority of the request is determined by the user (eventually via
    the context) but may be overridden at any time by the driver. When we set
    the priority of the request, we bump the priority of all of its
    dependencies to match - so that a high priority drawing operation is not
    stuck behind a background task.
    
    When the request is ready to execute (i.e. we have signaled the submit
    fence following completion of all its dependencies, including third
    party fences), we put the request into a priority sorted rbtree to be
    submitted to the hardware. If the request is higher priority than all
    pending requests, it will be submitted on the next context-switch
    interrupt as soon as the hardware has completed the current request. We
    do not currently preempt any current execution to immediately run a very
    high priority request, at least not yet.
    
    One more limitation, is that this is first implementation is for
    execlists only so currently limited to gen8/gen9.
    
    v2: Replace recursive priority inheritance bumping with an iterative
    depth-first search list.
    v3: list_next_entry() for walking lists
    v4: Explain how the dfs solves the recursion problem with PI.
    Signed-off-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
    Reviewed-by: default avatarTvrtko Ursulin <tvrtko.ursulin@intel.com>
    Link: http://patchwork.freedesktop.org/patch/msgid/20161114204105.29171-8-chris@chris-wilson.co.uk
    20311bd3
intel_engine_cs.c 12.8 KB