Commit f997056d authored by Chris Wilson's avatar Chris Wilson

drm/i915/gt: Push the flush_pd before the set-context

Move our "wait for the PD load to complete" paranoia before the
MI_SET_CONTEXT just in case the context restore tries to access local
addresses.
Signed-off-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
Acked-by: default avatarMika Kuoppala <mika.kuoppala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20191130120503.1609483-1-chris@chris-wilson.co.uk
parent 3cd6e886
...@@ -1591,24 +1591,11 @@ static int switch_context(struct i915_request *rq) ...@@ -1591,24 +1591,11 @@ static int switch_context(struct i915_request *rq)
GEM_BUG_ON(HAS_EXECLISTS(rq->i915)); GEM_BUG_ON(HAS_EXECLISTS(rq->i915));
if (vm) { if (vm) {
ret = load_pd_dir(rq, i915_vm_to_ppgtt(vm)); struct intel_engine_cs *engine = rq->engine;
if (ret)
return ret;
}
if (ce->state) {
GEM_BUG_ON(rq->engine->id != RCS0);
if (!rq->engine->default_state)
hw_flags = MI_RESTORE_INHIBIT;
ret = mi_set_context(rq, hw_flags); ret = load_pd_dir(rq, i915_vm_to_ppgtt(vm));
if (ret) if (ret)
return ret; return ret;
}
if (vm) {
struct intel_engine_cs *engine = rq->engine;
ret = engine->emit_flush(rq, EMIT_INVALIDATE); ret = engine->emit_flush(rq, EMIT_INVALIDATE);
if (ret) if (ret)
...@@ -1635,6 +1622,17 @@ static int switch_context(struct i915_request *rq) ...@@ -1635,6 +1622,17 @@ static int switch_context(struct i915_request *rq)
return ret; return ret;
} }
if (ce->state) {
GEM_BUG_ON(rq->engine->id != RCS0);
if (!rq->engine->default_state)
hw_flags = MI_RESTORE_INHIBIT;
ret = mi_set_context(rq, hw_flags);
if (ret)
return ret;
}
ret = remap_l3(rq); ret = remap_l3(rq);
if (ret) if (ret)
return ret; return ret;
......
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