[v2,6/6] drm/i915: Allow Broadwell guest with Intel GVT-g
diff mbox

Message ID 1440747679-20716-7-git-send-email-zhiyuan.lv@intel.com
State New
Headers show

Commit Message

Zhiyuan Lv Aug. 28, 2015, 7:41 a.m. UTC
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@intel.com>
Signed-off-by: Zhi Wang <zhi.a.wang@intel.com>
Reviewed-by: Joonas Lahtinen <joonas.lahtinen@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(-)

Comments

Daniel Vetter Sept. 2, 2015, 9:47 a.m. UTC | #1
On Fri, Aug 28, 2015 at 03:41:19PM +0800, Zhiyuan Lv wrote:
> 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@intel.com>
> Signed-off-by: Zhi Wang <zhi.a.wang@intel.com>
> Reviewed-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>

I'll hold of on this one for the polished version of patch 2, but all
others are merged to dinq.

Thanks, Daniel

> ---
>  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
> 
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/intel-gfx

Patch
diff mbox

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);