drm/i915: Enable guest i915 full ppgtt functionality
Subsystems (2)
PATCH v5 1/1 drm/i915: Enable guest i915 full ppgtt functionality
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)
Change since v4:
- Tested by Tina Zhang.
drivers/gpu/drm/i915/i915_drv.h +1 -0
@@ -1863,6 +1863,7 @@ struct i915_workarounds {struct i915_virtual_gpu {bool active; +u32 caps; };/* used in computing the new watermarks state */
drivers/gpu/drm/i915/i915_gem_gtt.c +5 -6
@@ -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 ;
drivers/gpu/drm/i915/i915_pvinfo.h +7 -1
@@ -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.
drivers/gpu/drm/i915/i915_vgpu.c +7 -0
@@ -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
drivers/gpu/drm/i915/i915_vgpu.h +3 -0
@@ -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);
Signature · 6 lines
2.7.4 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Patchwork
CI✓ Fi.CI.BAT: success for drm/i915: Enable guest i915 full ppgtt functionality (rev3)
== Series Details ==
== Series Details ==
Series: drm/i915: Enable guest i915 full ppgtt functionality (rev3)
URL : https://patchwork.freedesktop.org/series/24774/
State : success
== Summary ==
Series 24774v3 drm/i915: Enable guest i915 full ppgtt functionality
https://patchwork.freedesktop.org/api/1.0/series/24774/revisions/3/mbox/
Test gem_exec_flush:
Subgroup basic-batch-kernel-default-uc:
pass -> FAIL (fi-snb-2600) fdo#100007
Test gem_exec_suspend:
Subgroup basic-s4-devices:
pass -> DMESG-WARN (fi-kbl-7560u) fdo#100125fdo#100007 https://bugs.freedesktop.org/show_bug.cgi?id=100007
fdo#100125 https://bugs.freedesktop.org/show_bug.cgi?id=100125
fi-bdw-5557u total:278 pass:267 dwarn:0 dfail:0 fail:0 skip:11 time:442s fi-bdw-gvtdvm total:278 pass:256 dwarn:8 dfail:0 fail:0 skip:14 time:431s fi-bsw-n3050 total:278 pass:242 dwarn:0 dfail:0 fail:0 skip:36 time:578s fi-bxt-j4205 total:278 pass:259 dwarn:0 dfail:0 fail:0 skip:19 time:518s fi-byt-j1900 total:278 pass:254 dwarn:0 dfail:0 fail:0 skip:24 time:491s fi-byt-n2820 total:278 pass:250 dwarn:0 dfail:0 fail:0 skip:28 time:478s fi-glk-2a total:278 pass:259 dwarn:0 dfail:0 fail:0 skip:19 time:595s fi-hsw-4770 total:278 pass:262 dwarn:0 dfail:0 fail:0 skip:16 time:427s fi-hsw-4770r total:278 pass:262 dwarn:0 dfail:0 fail:0 skip:16 time:416s fi-ilk-650 total:278 pass:228 dwarn:0 dfail:0 fail:0 skip:50 time:422s fi-ivb-3520m total:278 pass:260 dwarn:0 dfail:0 fail:0 skip:18 time:493s fi-ivb-3770 total:278 pass:260 dwarn:0 dfail:0 fail:0 skip:18 time:466s fi-kbl-7500u total:278 pass:260 dwarn:0 dfail:0 fail:0 skip:18 time:464s fi-kbl-7560u total:278 pass:267 dwarn:1 dfail:0 fail:0 skip:10 time:571s fi-kbl-r total:278 pass:259 dwarn:1 dfail:0 fail:0 skip:18 time:581s 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:403s fi-skl-6700k total:278 pass:256 dwarn:4 dfail:0 fail:0 skip:18 time:473s fi-skl-6770hq total:278 pass:268 dwarn:0 dfail:0 fail:0 skip:10 time:503s fi-skl-gvtdvm total:278 pass:265 dwarn:0 dfail:0 fail:0 skip:13 time:439s fi-snb-2520m total:278 pass:250 dwarn:0 dfail:0 fail:0 skip:28 time:532s fi-snb-2600 total:278 pass:248 dwarn:0 dfail:0 fail:1 skip:29 time:401s
5b363842b49a66879d4c67d652923fb04e44b271 drm-tip: 2017y-06m-08d-20h-34m-37s UTC integration manifest 0cb3388 drm/i915: Enable guest i915 full ppgtt functionality
== Logs ==
For more details see: https://intel-gfx-ci.01.org/CI/Patchwork_4920/
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx