Commit 497aa3f5 authored by Zhi Wang's avatar Zhi Wang Committed by Zhenyu Wang

drm/i915/gvt: Factor out prepare_workload()

Factor out prepare_workload() for the following re-factor.
Signed-off-by: default avatarZhi Wang <zhi.a.wang@intel.com>
parent 21527a8d
...@@ -325,6 +325,16 @@ int intel_gvt_scan_and_shadow_workload(struct intel_vgpu_workload *workload) ...@@ -325,6 +325,16 @@ int intel_gvt_scan_and_shadow_workload(struct intel_vgpu_workload *workload)
return ret; return ret;
} }
static int prepare_workload(struct intel_vgpu_workload *workload)
{
int ret = 0;
if (workload->prepare)
ret = workload->prepare(workload);
return ret;
}
static int dispatch_workload(struct intel_vgpu_workload *workload) static int dispatch_workload(struct intel_vgpu_workload *workload)
{ {
struct intel_vgpu *vgpu = workload->vgpu; struct intel_vgpu *vgpu = workload->vgpu;
...@@ -344,13 +354,11 @@ static int dispatch_workload(struct intel_vgpu_workload *workload) ...@@ -344,13 +354,11 @@ static int dispatch_workload(struct intel_vgpu_workload *workload)
if (ret) if (ret)
goto out; goto out;
if (workload->prepare) { ret = prepare_workload(workload);
ret = workload->prepare(workload);
if (ret) { if (ret) {
engine->context_unpin(engine, shadow_ctx); engine->context_unpin(engine, shadow_ctx);
goto out; goto out;
} }
}
out: out:
if (ret) if (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