summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/i915/i915_vgpu.h
diff options
context:
space:
mode:
authorYu Zhang <yu.c.zhang@linux.intel.com>2015-02-10 19:05:48 +0800
committerDaniel Vetter <daniel.vetter@ffwll.ch>2015-02-13 23:28:23 +0100
commit5dda8fa356587832e5373498d8b973d66735762d (patch)
treef8f01a75840def0fb0f3b389a4b0b50182bd1b2c /drivers/gpu/drm/i915/i915_vgpu.h
parentcf9d2890da19d9544d655554da907049e8226d14 (diff)
downloadlinux-5dda8fa356587832e5373498d8b973d66735762d.tar.bz2
drm/i915: Adds graphic address space ballooning logic
With Intel GVT-g, the global graphic memory space is partitioned by multiple vGPU instances in different VMs. The ballooning code is called in i915_gem_setup_global_gtt(), utilizing the drm mm allocator APIs to mark the graphic address space which are partitioned out to other vGPUs as reserved. With ballooning, host side does not need to translate a grahpic address from guest view to host view. By now, current implementation only support the static ballooning, but in the future, with more cooperation from guest driver, the same interfaces can be extended to grow/shrink the guest graphic memory dynamically. v2: take Chris and Daniel's comments: - no guard page between different VMs - use drm_mm_reserve_node() to do the reservation for ballooning, instead of the previous drm_mm_insert_node_in_range_generic() v3: take Daniel's comments: - move ballooning functions into i915_vgpu.c - add kerneldoc to ballooning functions v4: take Tvrtko's comments: - more accurate comments and commit message Signed-off-by: Yu Zhang <yu.c.zhang@linux.intel.com> Signed-off-by: Jike Song <jike.song@intel.com> Signed-off-by: Zhi Wang <zhi.a.wang@intel.com> Signed-off-by: Eddie Dong <eddie.dong@intel.com> Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Diffstat (limited to 'drivers/gpu/drm/i915/i915_vgpu.h')
-rw-r--r--drivers/gpu/drm/i915/i915_vgpu.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/gpu/drm/i915/i915_vgpu.h b/drivers/gpu/drm/i915/i915_vgpu.h
index aa72e146d6c8..3ed01a7ac48e 100644
--- a/drivers/gpu/drm/i915/i915_vgpu.h
+++ b/drivers/gpu/drm/i915/i915_vgpu.h
@@ -81,5 +81,7 @@ struct vgt_if {
(VGT_PVINFO_PAGE + (long)&((struct vgt_if *)NULL)->x)
extern void i915_check_vgpu(struct drm_device *dev);
+extern int intel_vgt_balloon(struct drm_device *dev);
+extern void intel_vgt_deballoon(void);
#endif /* _I915_VGPU_H_ */