Skip to content

Commit

Permalink
drm/i915/gvt: Refine error handling in dispatch_workload
Browse files Browse the repository at this point in the history
When an error occurs in dispatch_workload, this patch is to do the
proper cleanup and rollback to the original states before the workload
is abandoned.

v2:
- split the mixed several error paths for better review. (Zhenyu)

v3:
- original PTR_ERR(cs) is good and code cleanup. (Zhenyu)

v4:
- reuse the existing i915_add_request for error handling. (Zhenyu)

v5:
- remove the duplicate error handling release_shadow_wa_ctx and
  move the engine->context_unpin upper. (Zhenyu)

v6:
- keep the old label "out". (Zhenyu)

Signed-off-by: fred gao <fred.gao@intel.com>
Signed-off-by: Zhenyu Wang <zhenyuw@linux.intel.com>
  • Loading branch information
fred gao authored and Zhenyu Wang committed Sep 8, 2017
1 parent 46b441e commit 0f43702
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion drivers/gpu/drm/i915/gvt/scheduler.c
Original file line number Diff line number Diff line change
Expand Up @@ -342,8 +342,10 @@ static int dispatch_workload(struct intel_vgpu_workload *workload)

if (workload->prepare) {
ret = workload->prepare(workload);
if (ret)
if (ret) {
engine->context_unpin(engine, shadow_ctx);
goto out;
}
}

out:
Expand Down

0 comments on commit 0f43702

Please sign in to comment.