drm/i915/guc: Advance over port[0] if set and not preempting

Our execlist emulation is intended to only use a maximum of 2 ports per
engine, so as to not overflow the wq. (By knowing the limits, we can
avoid having to handle the wq exhaustion.) However, upon adding
preemption, we lost the skip over the first port if set for the
non-preemption path. Restore it.

Reported-by: Mika Kuoppala <mika.kuoppala@linux.intel.com>
Fixes: c41937fd99 ("drm/i915/guc: Preemption! With GuC")
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Michał Winiarski <michal.winiarski@intel.com>
Cc: Mika Kuoppala <mika.kuoppala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20171124133745.5173-1-chris@chris-wilson.co.uk
Reviewed-by: Mika Kuoppala <mika.kuoppala@linux.intel.com>
Reviewed-by: Michał Winiarski <michal.winiarski@intel.com>
This commit is contained in:
Chris Wilson 2017-11-24 13:37:44 +00:00
parent bb9e0d4bca
commit aa34a6fc27
1 changed files with 15 additions and 12 deletions

View File

@ -743,23 +743,26 @@ static void guc_dequeue(struct intel_engine_cs *engine)
if (!rb) if (!rb)
goto unlock; goto unlock;
if (HAS_LOGICAL_RING_PREEMPTION(engine->i915) && port_isset(port)) { if (port_isset(port)) {
struct guc_preempt_work *preempt_work = if (HAS_LOGICAL_RING_PREEMPTION(engine->i915)) {
&engine->i915->guc.preempt_work[engine->id]; struct guc_preempt_work *preempt_work =
&engine->i915->guc.preempt_work[engine->id];
if (rb_entry(rb, struct i915_priolist, node)->priority > if (rb_entry(rb, struct i915_priolist, node)->priority >
max(port_request(port)->priotree.priority, 0)) { max(port_request(port)->priotree.priority, 0)) {
execlists_set_active(execlists, execlists_set_active(execlists,
EXECLISTS_ACTIVE_PREEMPT); EXECLISTS_ACTIVE_PREEMPT);
queue_work(engine->i915->guc.preempt_wq, queue_work(engine->i915->guc.preempt_wq,
&preempt_work->work); &preempt_work->work);
goto unlock; goto unlock;
} else if (port_isset(last_port)) { }
goto unlock;
} }
port++; port++;
if (port_isset(port))
goto unlock;
} }
GEM_BUG_ON(port_isset(port));
do { do {
struct i915_priolist *p = rb_entry(rb, typeof(*p), node); struct i915_priolist *p = rb_entry(rb, typeof(*p), node);