On Tue, Mar 28, 2017 at 08:00:27PM +0200, Michał Winiarski wrote:
> Normally when we're inserting requests with equal priority, we're using
> FIFO ordering. However, when we're resubmitting requests it's helpful
> to be able to ensure that they're executed before their dependencies,
> meaning that we need to use LIFO ordering instead.
> 
> Cc: Chris Wilson <[email protected]>
> Cc: Joonas Lahtinen <[email protected]>
> Cc: Tvrtko Ursulin <[email protected]>
> Signed-off-by: Michał Winiarski <[email protected]>
> ---
>  drivers/gpu/drm/i915/intel_lrc.c | 15 ++++++++++-----
>  1 file changed, 10 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/intel_lrc.c 
> b/drivers/gpu/drm/i915/intel_lrc.c
> index 301ae7c..107cf91 100644
> --- a/drivers/gpu/drm/i915/intel_lrc.c
> +++ b/drivers/gpu/drm/i915/intel_lrc.c
> @@ -611,12 +611,15 @@ static void intel_lrc_irq_handler(unsigned long data)
>       intel_uncore_forcewake_put(dev_priv, engine->fw_domains);
>  }
>  
> -static bool insert_request(struct i915_priotree *pt, struct rb_root *root)
> +static bool insert_request(struct i915_priotree *pt, struct rb_root *root,
> +                        bool reinsert)

I would just use a different insertion routine for unsubmit. The most
likely insertion point is execlist_first and so we can optimise the
reinsert to begin it's search there (we'll only have to search if there
were higher (than it) priority requests added that didn't trigger a
preemption).

I am not keen on making insert_request more complicated, semantically at
least. execlists_schedule() is built around the idea that the dependency
graphs are always have an order to their priority (no dependent request
can have a greater priority than their dependencies). insert_request()
is tightly coupled into that picture.

I need more coaxing, I have this nagging feeling that there is a simpler
way.
-Chris

-- 
Chris Wilson, Intel Open Source Technology Centre
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

Reply via email to