Commit 3d09677a authored by Chris Wilson's avatar Chris Wilson

drm/i915/execlists: Lift opportunistic process_csb to before engine lock

Since the process_csb() does not require us to hold the
engine->active.lock, we can move the opportunistic flush before
direction submission to outside of the lock.
Signed-off-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: default avatarMika Kuoppala <mika.kuoppala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200612221113.9129-1-chris@chris-wilson.co.uk
parent 51dc276d
...@@ -3170,13 +3170,6 @@ static void __submit_queue_imm(struct intel_engine_cs *engine) ...@@ -3170,13 +3170,6 @@ static void __submit_queue_imm(struct intel_engine_cs *engine)
if (reset_in_progress(execlists)) if (reset_in_progress(execlists))
return; /* defer until we restart the engine following reset */ return; /* defer until we restart the engine following reset */
/* Hopefully we clear execlists->pending[] to let us through */
if (READ_ONCE(execlists->pending[0]) &&
tasklet_trylock(&execlists->tasklet)) {
process_csb(engine);
tasklet_unlock(&execlists->tasklet);
}
__execlists_submission_tasklet(engine); __execlists_submission_tasklet(engine);
} }
...@@ -3199,11 +3192,25 @@ static bool ancestor_on_hold(const struct intel_engine_cs *engine, ...@@ -3199,11 +3192,25 @@ static bool ancestor_on_hold(const struct intel_engine_cs *engine,
return !list_empty(&engine->active.hold) && hold_request(rq); return !list_empty(&engine->active.hold) && hold_request(rq);
} }
static void flush_csb(struct intel_engine_cs *engine)
{
struct intel_engine_execlists *el = &engine->execlists;
if (READ_ONCE(el->pending[0]) && tasklet_trylock(&el->tasklet)) {
if (!reset_in_progress(el))
process_csb(engine);
tasklet_unlock(&el->tasklet);
}
}
static void execlists_submit_request(struct i915_request *request) static void execlists_submit_request(struct i915_request *request)
{ {
struct intel_engine_cs *engine = request->engine; struct intel_engine_cs *engine = request->engine;
unsigned long flags; unsigned long flags;
/* Hopefully we clear execlists->pending[] to let us through */
flush_csb(engine);
/* Will be called from irq-context when using foreign fences. */ /* Will be called from irq-context when using foreign fences. */
spin_lock_irqsave(&engine->active.lock, flags); spin_lock_irqsave(&engine->active.lock, flags);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment