public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
* [PATCH v4] drm/i915: Enable guest i915 full ppgtt functionality
@ 2017-06-05  6:55 Tina Zhang
  2017-06-05  8:43 ` ✓ Fi.CI.BAT: success for drm/i915: Enable guest i915 full ppgtt functionality (rev2) Patchwork
  2017-06-07  9:30 ` [PATCH v4] drm/i915: Enable guest i915 full ppgtt functionality Zhenyu Wang
  0 siblings, 2 replies; 4+ messages in thread
From: Tina Zhang @ 2017-06-05  6:55 UTC (permalink / raw)
  To: intel-gfx; +Cc: intel-gvt-dev

Enable the guest i915 full ppgtt functionality when host can provide this
capability. vgt_caps is introduced to guest i915 driver to get the vgpu
capabilities from the device model. VGT_CPAS_FULL_PPGTT is one of the
capabilities type to let guest i915 dirver know that the guest i915 full
ppgtt is supported by device model.

Notice that the minor version of pvinfo isn't bumped because of this
vgt_caps introduction, due to older guest would be broken by simply
increasing the pvinfo version. Although the pvinfo minor version doesn't
increase, the compatibility won't be blocked. The compatibility is ensured
by checking the value of caps field in pvinfo. Zero means no full ppgtt
support and BIT(2) means this feature is provided.

Changes since v1:
- Use u32 instead of uint32_t (Joonas)
- Move VGT_CAPS_FULL_PPGTT introduction to this patch and use #define
  instead of enum (Joonas)
- Rewrite the vgpu full ppgtt capability checking logic. (Joonas)
- Some coding style refine. (Joonas)

Changes since v2:
- Divide the whole patch set into two separate patch series, with one
  patch in i915 side to check guest i915 full ppgtt capability and enable
  it when this capability is supported by the device model, and the other
  one in gvt side which fixs the blocking issue and enables the device
  model to provide the capability to guest. And this patch focuses on guest
  i915 side. (Joonas)
- Change the title from "introduce vgt_caps to pvinfo" to
  "Enable guest i915 full ppgtt functionality". (Tina)

Change since v3:
- Add some comments about pvinfo caps and version. (Joonas)

Reviewed-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com> in v2
Signed-off-by: Tina Zhang <tina.zhang@intel.com>

diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
index bde554e..8430484 100644
--- a/drivers/gpu/drm/i915/i915_drv.h
+++ b/drivers/gpu/drm/i915/i915_drv.h
@@ -1861,6 +1861,7 @@ struct i915_workarounds {
 
 struct i915_virtual_gpu {
 	bool active;
+	u32 caps;
 };
 
 /* used in computing the new watermarks state */
diff --git a/drivers/gpu/drm/i915/i915_gem_gtt.c b/drivers/gpu/drm/i915/i915_gem_gtt.c
index 0c1008a..67c0d75 100644
--- a/drivers/gpu/drm/i915/i915_gem_gtt.c
+++ b/drivers/gpu/drm/i915/i915_gem_gtt.c
@@ -141,13 +141,12 @@ int intel_sanitize_enable_ppgtt(struct drm_i915_private *dev_priv,
 
 	has_aliasing_ppgtt = dev_priv->info.has_aliasing_ppgtt;
 	has_full_ppgtt = dev_priv->info.has_full_ppgtt;
-	has_full_48bit_ppgtt = dev_priv->info.has_full_48bit_ppgtt;
 
-	if (intel_vgpu_active(dev_priv)) {
-		/* emulation is too hard */
-		has_full_ppgtt = false;
-		has_full_48bit_ppgtt = false;
-	}
+	if (intel_vgpu_active(dev_priv))
+		has_full_ppgtt = intel_vgpu_has_full_ppgtt(dev_priv);
+
+	has_full_48bit_ppgtt = has_full_ppgtt &&
+		dev_priv->info.has_full_48bit_ppgtt;
 
 	if (!has_aliasing_ppgtt)
 		return 0;
diff --git a/drivers/gpu/drm/i915/i915_pvinfo.h b/drivers/gpu/drm/i915/i915_pvinfo.h
index c0cb297..8dc0664 100644
--- a/drivers/gpu/drm/i915/i915_pvinfo.h
+++ b/drivers/gpu/drm/i915/i915_pvinfo.h
@@ -53,12 +53,18 @@ enum vgt_g2v_type {
 	VGT_G2V_MAX,
 };
 
+/*
+ * VGT capabilities type
+ */
+#define VGT_CAPS_FULL_PPGTT	BIT(2)
+
 struct vgt_if {
 	u64 magic;		/* VGT_MAGIC */
 	uint16_t version_major;
 	uint16_t version_minor;
 	u32 vgt_id;		/* ID of vGT instance */
-	u32 rsv1[12];		/* pad to offset 0x40 */
+	u32 vgt_caps;		/* VGT capabilities */
+	u32 rsv1[11];		/* pad to offset 0x40 */
 	/*
 	 *  Data structure to describe the balooning info of resources.
 	 *  Each VM can only have one portion of continuous area for now.
diff --git a/drivers/gpu/drm/i915/i915_vgpu.c b/drivers/gpu/drm/i915/i915_vgpu.c
index 4ab8a97..adc4eda 100644
--- a/drivers/gpu/drm/i915/i915_vgpu.c
+++ b/drivers/gpu/drm/i915/i915_vgpu.c
@@ -77,10 +77,17 @@ void i915_check_vgpu(struct drm_i915_private *dev_priv)
 		return;
 	}
 
+	dev_priv->vgpu.caps = __raw_i915_read32(dev_priv, vgtif_reg(vgt_caps));
+
 	dev_priv->vgpu.active = true;
 	DRM_INFO("Virtual GPU for Intel GVT-g detected.\n");
 }
 
+bool intel_vgpu_has_full_ppgtt(struct drm_i915_private *dev_priv)
+{
+	return dev_priv->vgpu.caps & VGT_CAPS_FULL_PPGTT;
+}
+
 struct _balloon_info_ {
 	/*
 	 * There are up to 2 regions per mappable/unmappable graphic
diff --git a/drivers/gpu/drm/i915/i915_vgpu.h b/drivers/gpu/drm/i915/i915_vgpu.h
index 3c3b2d2..b4e04eb 100644
--- a/drivers/gpu/drm/i915/i915_vgpu.h
+++ b/drivers/gpu/drm/i915/i915_vgpu.h
@@ -27,6 +27,9 @@
 #include "i915_pvinfo.h"
 
 void i915_check_vgpu(struct drm_i915_private *dev_priv);
+
+bool intel_vgpu_has_full_ppgtt(struct drm_i915_private *dev_priv);
+
 int intel_vgt_balloon(struct drm_i915_private *dev_priv);
 void intel_vgt_deballoon(struct drm_i915_private *dev_priv);
 
-- 
2.7.4

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* ✓ Fi.CI.BAT: success for drm/i915: Enable guest i915 full ppgtt functionality (rev2)
  2017-06-05  6:55 [PATCH v4] drm/i915: Enable guest i915 full ppgtt functionality Tina Zhang
@ 2017-06-05  8:43 ` Patchwork
  2017-06-07  9:30 ` [PATCH v4] drm/i915: Enable guest i915 full ppgtt functionality Zhenyu Wang
  1 sibling, 0 replies; 4+ messages in thread
From: Patchwork @ 2017-06-05  8:43 UTC (permalink / raw)
  To: Tina Zhang; +Cc: intel-gfx

== Series Details ==

Series: drm/i915: Enable guest i915 full ppgtt functionality (rev2)
URL   : https://patchwork.freedesktop.org/series/24774/
State : success

== Summary ==

Series 24774v2 drm/i915: Enable guest i915 full ppgtt functionality
https://patchwork.freedesktop.org/api/1.0/series/24774/revisions/2/mbox/

fi-bdw-5557u     total:278  pass:267  dwarn:0   dfail:0   fail:0   skip:11  time:441s
fi-bdw-gvtdvm    total:278  pass:256  dwarn:8   dfail:0   fail:0   skip:14  time:433s
fi-bsw-n3050     total:278  pass:242  dwarn:0   dfail:0   fail:0   skip:36  time:583s
fi-bxt-j4205     total:278  pass:259  dwarn:0   dfail:0   fail:0   skip:19  time:510s
fi-byt-j1900     total:278  pass:254  dwarn:0   dfail:0   fail:0   skip:24  time:486s
fi-byt-n2820     total:278  pass:250  dwarn:0   dfail:0   fail:0   skip:28  time:483s
fi-hsw-4770      total:278  pass:262  dwarn:0   dfail:0   fail:0   skip:16  time:431s
fi-hsw-4770r     total:278  pass:262  dwarn:0   dfail:0   fail:0   skip:16  time:411s
fi-ilk-650       total:278  pass:228  dwarn:0   dfail:0   fail:0   skip:50  time:418s
fi-ivb-3520m     total:278  pass:260  dwarn:0   dfail:0   fail:0   skip:18  time:489s
fi-ivb-3770      total:278  pass:260  dwarn:0   dfail:0   fail:0   skip:18  time:466s
fi-kbl-7500u     total:278  pass:255  dwarn:5   dfail:0   fail:0   skip:18  time:464s
fi-kbl-7560u     total:278  pass:263  dwarn:5   dfail:0   fail:0   skip:10  time:570s
fi-skl-6260u     total:278  pass:268  dwarn:0   dfail:0   fail:0   skip:10  time:457s
fi-skl-6700hq    total:278  pass:228  dwarn:1   dfail:0   fail:27  skip:22  time:399s
fi-skl-6700k     total:278  pass:256  dwarn:4   dfail:0   fail:0   skip:18  time:467s
fi-skl-6770hq    total:278  pass:268  dwarn:0   dfail:0   fail:0   skip:10  time:502s
fi-skl-gvtdvm    total:278  pass:265  dwarn:0   dfail:0   fail:0   skip:13  time:443s
fi-snb-2520m     total:278  pass:250  dwarn:0   dfail:0   fail:0   skip:28  time:536s
fi-snb-2600      total:278  pass:249  dwarn:0   dfail:0   fail:0   skip:29  time:404s

d919ad0d077110d2d48a4b7503ddc02c3864667d drm-tip: 2017y-06m-02d-21h-49m-57s UTC integration manifest
30a342c drm/i915: Enable guest i915 full ppgtt functionality

== Logs ==

For more details see: https://intel-gfx-ci.01.org/CI/Patchwork_4873/
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH v4] drm/i915: Enable guest i915 full ppgtt functionality
  2017-06-05  6:55 [PATCH v4] drm/i915: Enable guest i915 full ppgtt functionality Tina Zhang
  2017-06-05  8:43 ` ✓ Fi.CI.BAT: success for drm/i915: Enable guest i915 full ppgtt functionality (rev2) Patchwork
@ 2017-06-07  9:30 ` Zhenyu Wang
  2017-06-08 10:20   ` Joonas Lahtinen
  1 sibling, 1 reply; 4+ messages in thread
From: Zhenyu Wang @ 2017-06-07  9:30 UTC (permalink / raw)
  To: Tina Zhang; +Cc: intel-gfx, intel-gvt-dev


[-- Attachment #1.1: Type: text/plain, Size: 2641 bytes --]

On 2017.06.05 14:55:41 +0800, Tina Zhang wrote:
> Enable the guest i915 full ppgtt functionality when host can provide this
> capability. vgt_caps is introduced to guest i915 driver to get the vgpu
> capabilities from the device model. VGT_CPAS_FULL_PPGTT is one of the
> capabilities type to let guest i915 dirver know that the guest i915 full
> ppgtt is supported by device model.
> 
> Notice that the minor version of pvinfo isn't bumped because of this
> vgt_caps introduction, due to older guest would be broken by simply
> increasing the pvinfo version. Although the pvinfo minor version doesn't
> increase, the compatibility won't be blocked. The compatibility is ensured
> by checking the value of caps field in pvinfo. Zero means no full ppgtt
> support and BIT(2) means this feature is provided.
> 
> Changes since v1:
> - Use u32 instead of uint32_t (Joonas)
> - Move VGT_CAPS_FULL_PPGTT introduction to this patch and use #define
>   instead of enum (Joonas)
> - Rewrite the vgpu full ppgtt capability checking logic. (Joonas)
> - Some coding style refine. (Joonas)
> 
> Changes since v2:
> - Divide the whole patch set into two separate patch series, with one
>   patch in i915 side to check guest i915 full ppgtt capability and enable
>   it when this capability is supported by the device model, and the other
>   one in gvt side which fixs the blocking issue and enables the device
>   model to provide the capability to guest. And this patch focuses on guest
>   i915 side. (Joonas)
> - Change the title from "introduce vgt_caps to pvinfo" to
>   "Enable guest i915 full ppgtt functionality". (Tina)
> 
> Change since v3:
> - Add some comments about pvinfo caps and version. (Joonas)
> 
> Reviewed-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com> in v2
> Signed-off-by: Tina Zhang <tina.zhang@intel.com>
>

I'm a bit lost to find which one is the gvt change for this, could you resend
full series against latest gvt-staging again?

> diff --git a/drivers/gpu/drm/i915/i915_pvinfo.h b/drivers/gpu/drm/i915/i915_pvinfo.h
> index c0cb297..8dc0664 100644
> --- a/drivers/gpu/drm/i915/i915_pvinfo.h
> +++ b/drivers/gpu/drm/i915/i915_pvinfo.h
> @@ -53,12 +53,18 @@ enum vgt_g2v_type {
>  	VGT_G2V_MAX,
>  };
>  
> +/*
> + * VGT capabilities type
> + */
> +#define VGT_CAPS_FULL_PPGTT	BIT(2)
> +

As I think your gvt change will depend on this bit too, so have to merge
them in order, right? Joonas, ok for me to merge through gvt tree together
for -next pull?

-- 
Open Source Technology Center, Intel ltd.

$gpg --keyserver wwwkeys.pgp.net --recv-keys 4D781827

[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 195 bytes --]

[-- Attachment #2: Type: text/plain, Size: 160 bytes --]

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH v4] drm/i915: Enable guest i915 full ppgtt functionality
  2017-06-07  9:30 ` [PATCH v4] drm/i915: Enable guest i915 full ppgtt functionality Zhenyu Wang
@ 2017-06-08 10:20   ` Joonas Lahtinen
  0 siblings, 0 replies; 4+ messages in thread
From: Joonas Lahtinen @ 2017-06-08 10:20 UTC (permalink / raw)
  To: Zhenyu Wang, Tina Zhang; +Cc: intel-gfx, intel-gvt-dev

On ke, 2017-06-07 at 17:30 +0800, Zhenyu Wang wrote:
> On 2017.06.05 14:55:41 +0800, Tina Zhang wrote:
> > 
> > @@ -53,12 +53,18 @@ enum vgt_g2v_type {
> >  	VGT_G2V_MAX,
> >  };
> >  
> > +/*
> > + * VGT capabilities type
> > + */
> > +#define VGT_CAPS_FULL_PPGTT	BIT(2)
> > +
> 
> As I think your gvt change will depend on this bit too, so have to merge
> them in order, right? Joonas, ok for me to merge through gvt tree together
> for -next pull?

Yes, that way the ordering gets right. As mentioned in IRC, the
major/minor version checking should be merged first, and this updated
to use that.

Regards, Joonas
-- 
Joonas Lahtinen
Open Source Technology Center
Intel Corporation
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2017-06-08 10:20 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-06-05  6:55 [PATCH v4] drm/i915: Enable guest i915 full ppgtt functionality Tina Zhang
2017-06-05  8:43 ` ✓ Fi.CI.BAT: success for drm/i915: Enable guest i915 full ppgtt functionality (rev2) Patchwork
2017-06-07  9:30 ` [PATCH v4] drm/i915: Enable guest i915 full ppgtt functionality Zhenyu Wang
2017-06-08 10:20   ` Joonas Lahtinen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox