summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/i915/gvt/vgpu.c
diff options
context:
space:
mode:
authorZhi Wang <zhi.a.wang@intel.com>2016-04-26 01:28:56 +0300
committerZhenyu Wang <zhenyuw@linux.intel.com>2016-10-14 13:13:06 +0300
commit04d348ae3f0aea6523bc3b0688b5fc90c1c60d0e (patch)
tree1eadc499b3da6b57f1bebed7b81f77a79b9a8144 /drivers/gpu/drm/i915/gvt/vgpu.c
parente39c5add322184de3be052d438dfd24375bfeaea (diff)
downloadlinux-04d348ae3f0aea6523bc3b0688b5fc90c1c60d0e.tar.xz
drm/i915/gvt: vGPU display virtualization
This patch introduces the GVT-g display virtualization. It consists a collection of display MMIO handlers, like power well register handler, pipe register handler, plane register handler, which will emulate all display MMIOs behavior to support virtual mode setting sequence for guest. Signed-off-by: Bing Niu <bing.niu@intel.com> 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/vgpu.c')
-rw-r--r--drivers/gpu/drm/i915/gvt/vgpu.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/gpu/drm/i915/gvt/vgpu.c b/drivers/gpu/drm/i915/gvt/vgpu.c
index 2d4aaa781757..47ed0a085e4c 100644
--- a/drivers/gpu/drm/i915/gvt/vgpu.c
+++ b/drivers/gpu/drm/i915/gvt/vgpu.c
@@ -146,6 +146,7 @@ void intel_gvt_destroy_vgpu(struct intel_vgpu *vgpu)
vgpu->active = false;
idr_remove(&gvt->vgpu_idr, vgpu->id);
+ intel_vgpu_clean_display(vgpu);
intel_vgpu_clean_opregion(vgpu);
intel_vgpu_clean_gtt(vgpu);
intel_gvt_hypervisor_detach_vgpu(vgpu);
@@ -216,11 +217,17 @@ struct intel_vgpu *intel_gvt_create_vgpu(struct intel_gvt *gvt,
goto out_clean_gtt;
}
+ ret = intel_vgpu_init_display(vgpu);
+ if (ret)
+ goto out_clean_opregion;
+
vgpu->active = true;
mutex_unlock(&gvt->lock);
return vgpu;
+out_clean_opregion:
+ intel_vgpu_clean_opregion(vgpu);
out_clean_gtt:
intel_vgpu_clean_gtt(vgpu);
out_detach_hypervisor_vgpu: