[PATCH 0/8] Re-factoring GVT-g submission #2
Zhi Wang
zhi.a.wang at intel.com
Wed Sep 13 18:50:40 UTC 2017
This is #2 patchset of re-factoring GVT-g submission for new platform
enabling. Continued with previous series, this patchset factors out
a generic submission management layer which is to seperate the scheduler
with the HW submission emulation layer.
For now there are 4 major APIs in this layer:
1. intel_vgpu_setup_{submission, clean}_submission(). They are the
initializer/de-initializer of this layer.
2. intel_vgpu_select_submission_ops(). It's called when guest is configuring
specific HW submission. When a virtual submission interface is selected,
the HW submission emulation components will be called. When a NULL interface
is selected, the resource and virtual HW status in HW submission emulation
layer will be freed and reset.
With this process flow, guest can easily switch GuC and execlist model
by doing an vGPU reset. This also helps on one vGPU is used by Linux which
is using execlist first, then another guest is using vGuC.
All resource and states are well-managed naturally in this flow.
3. intel_vgpu_reset_submission(). It's called when a vGPU reset happens. The
upper level doesn't need to care about the reset of HW submission emulation
like before.
Now a HW submission emulation layer provides 3 callbacks:
init: called when the submission ops is selected.
clean: called when the submission ops is de-selected, usually in vGPU
destory.
reset: called when a vGPU reset happens.
This 3 callbacks should be enough for both vGuC and vExeclist.
Re-factor of vGPU workload management:
Now all the workload scan/shadow and PPGTT shadow management and other stuffs
, which needs to be done when creating a vGPU workload, have been moved into
scheduler.c and a new API called intel_vgpu_create_workload() is introduced.
Creating a vGPU workload in HW submission emulation layer is now much simpler:
static int submit_context(struct intel_vgpu *vgpu, int ring_id,
struct execlist_ctx_descriptor_format *desc,
bool emulate_schedule_in)
{
<SNIP>
workload = intel_vgpu_create_workload(vgpu, ring_id, desc);
if (IS_ERR(workload))
return PTR_ERR(workload);
workload->prepare = prepare_execlist_workload;
workload->complete = complete_execlist_workload;
<SNIP>
queue_workload(workload);
return 0;
}
Tested on my SKL NUC.
Zhi Wang (8):
drm/i915/gvt: Factor out vGPU workload creation/destroy
drm/i915/gvt: Factor out prepare_workload()
drm/i915/gvt: Move common workload preparation into prepare_workload()
drm/i915/gvt: Move common vGPU workload creation into scheduler.c
drm/i915/gvt: Remove one extra declaration in scheduler.h
drm/i915/gvt: Introduce vGPU submission ops
drm/i915/gvt: Introduce intel_vgpu_reset_submission
drm/i915/gvt: Move clean_workloads() into scheduler.c
drivers/gpu/drm/i915/gvt/execlist.c | 393 ++--------------------------
drivers/gpu/drm/i915/gvt/gvt.h | 15 ++
drivers/gpu/drm/i915/gvt/handlers.c | 16 +-
drivers/gpu/drm/i915/gvt/scheduler.c | 494 ++++++++++++++++++++++++++++++++++-
drivers/gpu/drm/i915/gvt/scheduler.h | 16 +-
drivers/gpu/drm/i915/gvt/vgpu.c | 17 +-
6 files changed, 563 insertions(+), 388 deletions(-)
--
2.7.4
More information about the intel-gvt-dev
mailing list