@@ -69,3 +69,21 @@ config DRM_I915_PRELIMINARY_HW_SUPPORT
option changes the default for that module option.
If in doubt, say "N".
+
+config I915_IGVT
+ bool "I915 Intel Graphics Virtualization Technology for shared vCPU(Intel GVT-g)"
+ depends on DRM_I915
+ default n
+ help
+ Intel GVT-g is an efficient GPU sharing technology among multiple Virtual
+ Machines (VMs), providing full GPU virtualization so native graphics driver
+ can run inside a VM seamlessly. Both 3D/Media/Compute tasks can be
+ accelerated simultaneously in multi-VMs, on an Intel Processor Graphics.
+ Intel GVT-g adopts a mediated pass-through concept, by passing through
+ performance-critical operations (frame buffer access and command submission),
+ while trap-and-emulating privileged operations (I/O, GPU page table, etc.).
+ Overall it can achieve a good balance between performance, feature and
+ sharing capability.
+
+ This option specifically enables 'vgt' component in i915 driver,
+ implementing vGPU device model and GPU sharing capability.
@@ -78,6 +78,10 @@ i915-y += dvo_ch7017.o \
i915-y += i915_dma.o \
i915_ums.o
+
+VGT := vgt
+i915-$(CONFIG_I915_IGVT) += $(VGT)/vgt.o
+
obj-$(CONFIG_DRM_I915) += i915.o
CFLAGS_i915_trace_points.o := -I$(src)
@@ -35,6 +35,8 @@
#include "i915_trace.h"
#include "intel_drv.h"
+#include "i915_vgt.h"
+
#include <linux/console.h>
#include <linux/module.h>
#include <linux/pm_runtime.h>
@@ -923,6 +925,14 @@ static int i915_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
driver.driver_features &= ~(DRIVER_USE_AGP);
+ if (i915.enable_vgt) {
+ if (!i915_start_vgt(pdev))
+ i915.enable_vgt = false;
+
+ DRM_INFO("i915_start_vgt %s\n", i915.enable_vgt ?
+ "succedded" : "failed");
+ }
+
return drm_get_pci_dev(pdev, ent, &driver);
}
new file mode 100644
@@ -0,0 +1,17 @@
+#ifndef _I915_VGT_H_
+#define _I915_VGT_H_
+
+#ifdef CONFIG_I915_IGVT
+
+bool i915_start_vgt(struct pci_dev *);
+
+#else /* !CONFIG_I915_IGVT */
+
+static inline bool i915_start_vgt(struct pci_dev *pdev)
+{
+ return false;
+}
+
+#endif /* CONFIG_I915_IGVT */
+
+#endif
new file mode 100644
@@ -0,0 +1,18 @@
+#include <linux/module.h>
+#include <linux/kthread.h>
+#include <linux/pci.h>
+
+#include "vgt.h"
+
+
+/**
+ * Initialize Intel GVT-g
+ *
+ * \return true for success
+ * \return false for failure
+ */
+bool i915_start_vgt(struct pci_dev *pdev)
+{
+ /* vgt is not yet integrated, this only means testing */
+ return false;
+}
new file mode 100644
@@ -0,0 +1,6 @@
+#ifndef _VGT_DRV_H_
+#define _VGT_DRV_H_
+
+#include "../i915_vgt.h"
+
+#endif
This patch introduces the skeleton of vgt, an i915 add-on for controlling physical GPU resources and sharing among VMs. Signed-off-by: Jike Song <jike.song@intel.com> --- drivers/gpu/drm/i915/Kconfig | 18 ++++++++++++++++++ drivers/gpu/drm/i915/Makefile | 4 ++++ drivers/gpu/drm/i915/i915_drv.c | 10 ++++++++++ drivers/gpu/drm/i915/i915_vgt.h | 17 +++++++++++++++++ drivers/gpu/drm/i915/vgt/vgt.c | 18 ++++++++++++++++++ drivers/gpu/drm/i915/vgt/vgt.h | 6 ++++++ 6 files changed, 73 insertions(+) create mode 100644 drivers/gpu/drm/i915/i915_vgt.h create mode 100644 drivers/gpu/drm/i915/vgt/vgt.c create mode 100644 drivers/gpu/drm/i915/vgt/vgt.h