提交 eb82289a 编写于 作者: Y Yu Zhang 提交者: Daniel Vetter

drm/i915: Partition the fence registers for vGPU in i915 driver

With Intel GVT-g, the fence registers are partitioned by multiple
vGPU instances in different VMs. Routine i915_gem_load() is modified
to reset the num_fence_regs, when the driver detects it's running in
a VM. Accesses to the fence registers from vGPU will be trapped and
remapped by the host side. And the allocated fence number is provided
in PV INFO page structure. By now, the value of fence number is fixed,
but in the future we can relax this limitation, to allocate the fence
registers dynamically from host side.
Signed-off-by: NYu Zhang <yu.c.zhang@linux.intel.com>
Signed-off-by: NJike Song <jike.song@intel.com>
Signed-off-by: NEddie Dong <eddie.dong@intel.com>
Reviewed-by: NTvrtko Ursulin <tvrtko.ursulin@intel.com>
Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
上级 5dda8fa3
...@@ -29,6 +29,7 @@ ...@@ -29,6 +29,7 @@
#include <drm/drm_vma_manager.h> #include <drm/drm_vma_manager.h>
#include <drm/i915_drm.h> #include <drm/i915_drm.h>
#include "i915_drv.h" #include "i915_drv.h"
#include "i915_vgpu.h"
#include "i915_trace.h" #include "i915_trace.h"
#include "intel_drv.h" #include "intel_drv.h"
#include <linux/oom.h> #include <linux/oom.h>
...@@ -4987,6 +4988,10 @@ i915_gem_load(struct drm_device *dev) ...@@ -4987,6 +4988,10 @@ i915_gem_load(struct drm_device *dev)
else else
dev_priv->num_fence_regs = 8; dev_priv->num_fence_regs = 8;
if (intel_vgpu_active(dev))
dev_priv->num_fence_regs =
I915_READ(vgtif_reg(avail_rs.fence_num));
/* Initialize fence registers to zero */ /* Initialize fence registers to zero */
INIT_LIST_HEAD(&dev_priv->mm.fence_list); INIT_LIST_HEAD(&dev_priv->mm.fence_list);
i915_gem_restore_fences(dev); i915_gem_restore_fences(dev);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册