aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/i915/gvt/execlist.c
diff options
context:
space:
mode:
authorZhi Wang <zhi.a.wang@intel.com>2016-05-01 07:42:16 -0400
committerZhenyu Wang <zhenyuw@linux.intel.com>2016-10-14 18:14:50 +0800
commite473405783c064a9d859d108010581bae8e9af40 (patch)
tree8c16c8763dbd90cd994ad530d02f64f98aa61718 /drivers/gpu/drm/i915/gvt/execlist.c
parentdrm/i915/gvt: vGPU workload submission (diff)
downloadlinux-dev-e473405783c064a9d859d108010581bae8e9af40.tar.xz
linux-dev-e473405783c064a9d859d108010581bae8e9af40.zip
drm/i915/gvt: vGPU workload scheduler
This patch introduces the vGPU workload scheduler routines. GVT workload scheduler is responsible for picking and executing GVT workload from current scheduled vGPU. Before the workload is submitted to host i915, the guest execlist context will be shadowed in the host GVT shadow context. the instructions in guest ring buffer will be copied into GVT shadow ring buffer. Then GVT-g workload scheduler will scan the instructions in guest ring buffer and submit it to host i915. Signed-off-by: Zhi Wang <zhi.a.wang@intel.com> Signed-off-by: Zhenyu Wang <zhenyuw@linux.intel.com>
Diffstat (limited to 'drivers/gpu/drm/i915/gvt/execlist.c')
-rw-r--r--drivers/gpu/drm/i915/gvt/execlist.c24
1 files changed, 23 insertions, 1 deletions
diff --git a/drivers/gpu/drm/i915/gvt/execlist.c b/drivers/gpu/drm/i915/gvt/execlist.c
index f149847cbd17..5ae738e16678 100644
--- a/drivers/gpu/drm/i915/gvt/execlist.c
+++ b/drivers/gpu/drm/i915/gvt/execlist.c
@@ -394,7 +394,7 @@ static int complete_execlist_workload(struct intel_vgpu_workload *workload)
gvt_dbg_el("complete workload %p status %d\n", workload,
workload->status);
- if (workload->status)
+ if (workload->status || vgpu->resetting)
goto out;
if (!list_empty(workload_q_head(vgpu, workload->ring_id))) {
@@ -672,3 +672,25 @@ int intel_vgpu_init_execlist(struct intel_vgpu *vgpu)
return 0;
}
+
+void intel_vgpu_reset_execlist(struct intel_vgpu *vgpu,
+ unsigned long ring_bitmap)
+{
+ int bit;
+ struct list_head *pos, *n;
+ struct intel_vgpu_workload *workload = NULL;
+
+ for_each_set_bit(bit, &ring_bitmap, sizeof(ring_bitmap) * 8) {
+ if (bit >= I915_NUM_ENGINES)
+ break;
+ /* free the unsubmited workload in the queue */
+ list_for_each_safe(pos, n, &vgpu->workload_q_head[bit]) {
+ workload = container_of(pos,
+ struct intel_vgpu_workload, list);
+ list_del_init(&workload->list);
+ free_workload(workload);
+ }
+
+ init_vgpu_execlist(vgpu, bit);
+ }
+}