[Intel-gfx] [PATCH v2 6/6] drm/i915: Allow Broadwell guest with Intel GVT-g

Zhiyuan Lv zhiyuan.lv at intel.com
Fri Aug 28 00:41:19 PDT 2015


I915 Broadwell guest driver is now supported to run inside a VM with
Intel GVT-g

v2:
- Introduce HAS_VGPU macro (Zhenyu Wang)

Signed-off-by: Zhiyuan Lv <zhiyuan.lv at intel.com>
Signed-off-by: Zhi Wang <zhi.a.wang at intel.com>
Reviewed-by: Joonas Lahtinen <joonas.lahtinen at linux.intel.com>
---
 drivers/gpu/drm/i915/i915_vgpu.c | 2 +-
 drivers/gpu/drm/i915/i915_vgpu.h | 2 ++
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/i915/i915_vgpu.c b/drivers/gpu/drm/i915/i915_vgpu.c
index 5eee75b..f98a979 100644
--- a/drivers/gpu/drm/i915/i915_vgpu.c
+++ b/drivers/gpu/drm/i915/i915_vgpu.c
@@ -66,7 +66,7 @@ void i915_check_vgpu(struct drm_device *dev)
 
 	BUILD_BUG_ON(sizeof(struct vgt_if) != VGT_PVINFO_SIZE);
 
-	if (!IS_HASWELL(dev))
+	if (!HAS_VGPU(dev))
 		return;
 
 	magic = readq(dev_priv->regs + vgtif_reg(magic));
diff --git a/drivers/gpu/drm/i915/i915_vgpu.h b/drivers/gpu/drm/i915/i915_vgpu.h
index 21c97f4..9a9eb57 100644
--- a/drivers/gpu/drm/i915/i915_vgpu.h
+++ b/drivers/gpu/drm/i915/i915_vgpu.h
@@ -114,6 +114,8 @@ struct vgt_if {
 #define VGT_DRV_DISPLAY_NOT_READY 0
 #define VGT_DRV_DISPLAY_READY     1  /* ready for display switch */
 
+#define HAS_VGPU(dev)	(IS_HASWELL(dev) || IS_BROADWELL(dev))
+
 extern void i915_check_vgpu(struct drm_device *dev);
 extern int intel_vgt_balloon(struct drm_device *dev);
 extern void intel_vgt_deballoon(void);
-- 
1.9.1



More information about the Intel-gfx mailing list