|
@@ -771,12 +771,14 @@ intel_logical_ring_advance_and_submit(struct drm_i915_gem_request *request)
|
|
if (intel_engine_stopped(engine))
|
|
if (intel_engine_stopped(engine))
|
|
return 0;
|
|
return 0;
|
|
|
|
|
|
- if (engine->last_context != request->ctx) {
|
|
|
|
- if (engine->last_context)
|
|
|
|
- intel_lr_context_unpin(engine->last_context, engine);
|
|
|
|
- intel_lr_context_pin(request->ctx, engine);
|
|
|
|
- engine->last_context = request->ctx;
|
|
|
|
- }
|
|
|
|
|
|
+ /* We keep the previous context alive until we retire the following
|
|
|
|
+ * request. This ensures that any the context object is still pinned
|
|
|
|
+ * for any residual writes the HW makes into it on the context switch
|
|
|
|
+ * into the next object following the breadcrumb. Otherwise, we may
|
|
|
|
+ * retire the context too early.
|
|
|
|
+ */
|
|
|
|
+ request->previous_context = engine->last_context;
|
|
|
|
+ engine->last_context = request->ctx;
|
|
|
|
|
|
if (dev_priv->guc.execbuf_client)
|
|
if (dev_priv->guc.execbuf_client)
|
|
i915_guc_submit(dev_priv->guc.execbuf_client, request);
|
|
i915_guc_submit(dev_priv->guc.execbuf_client, request);
|