@@ -517,6 +517,9 @@ void intel_gvt_reset_vgpu(struct intel_vgpu *vgpu);
void intel_gvt_activate_vgpu(struct intel_vgpu *vgpu);
void intel_gvt_deactivate_vgpu(struct intel_vgpu *vgpu);
+int intel_gvt_set_opregion(struct intel_vgpu *vgpu);
+int intel_gvt_set_edid(struct intel_vgpu *vgpu, int port_num);
+
/* validating GM functions */
#define vgpu_gmadr_is_aperture(vgpu, gmadr) \
((gmadr >= vgpu_aperture_gmadr_base(vgpu)) && \
@@ -57,9 +57,6 @@ struct intel_gvt_mpt {
dma_addr_t dma_addr);
int (*dma_pin_guest_page)(struct intel_vgpu *vgpu, dma_addr_t dma_addr);
-
- int (*set_opregion)(struct intel_vgpu *vgpu);
- int (*set_edid)(struct intel_vgpu *vgpu, int port_num);
bool (*is_valid_gfn)(struct intel_vgpu *vgpu, unsigned long gfn);
};
@@ -662,7 +662,7 @@ static int intel_vgpu_register_reg(struct intel_vgpu *vgpu,
return 0;
}
-static int kvmgt_set_opregion(struct intel_vgpu *vgpu)
+int intel_gvt_set_opregion(struct intel_vgpu *vgpu)
{
void *base;
int ret;
@@ -689,7 +689,7 @@ static int kvmgt_set_opregion(struct intel_vgpu *vgpu)
return ret;
}
-static int kvmgt_set_edid(struct intel_vgpu *vgpu, int port_num)
+int intel_gvt_set_edid(struct intel_vgpu *vgpu, int port_num)
{
struct intel_vgpu_port *port = intel_vgpu_port(vgpu, port_num);
struct vfio_edid_region *base;
@@ -2030,8 +2030,6 @@ static const struct intel_gvt_mpt kvmgt_mpt = {
.dma_map_guest_page = kvmgt_dma_map_guest_page,
.dma_unmap_guest_page = kvmgt_dma_unmap_guest_page,
.dma_pin_guest_page = kvmgt_dma_pin_guest_page,
- .set_opregion = kvmgt_set_opregion,
- .set_edid = kvmgt_set_edid,
.is_valid_gfn = kvmgt_is_valid_gfn,
};
@@ -210,38 +210,6 @@ intel_gvt_hypervisor_dma_pin_guest_page(struct intel_vgpu *vgpu,
return intel_gvt_host.mpt->dma_pin_guest_page(vgpu, dma_addr);
}
-/**
- * intel_gvt_hypervisor_set_opregion - Set opregion for guest
- * @vgpu: a vGPU
- *
- * Returns:
- * Zero on success, negative error code if failed.
- */
-static inline int intel_gvt_hypervisor_set_opregion(struct intel_vgpu *vgpu)
-{
- if (!intel_gvt_host.mpt->set_opregion)
- return 0;
-
- return intel_gvt_host.mpt->set_opregion(vgpu);
-}
-
-/**
- * intel_gvt_hypervisor_set_edid - Set EDID region for guest
- * @vgpu: a vGPU
- * @port_num: display port number
- *
- * Returns:
- * Zero on success, negative error code if failed.
- */
-static inline int intel_gvt_hypervisor_set_edid(struct intel_vgpu *vgpu,
- int port_num)
-{
- if (!intel_gvt_host.mpt->set_edid)
- return 0;
-
- return intel_gvt_host.mpt->set_edid(vgpu, port_num);
-}
-
/**
* intel_gvt_hypervisor_is_valid_gfn - check if a visible gfn
* @vgpu: a vGPU
@@ -426,14 +426,14 @@ static struct intel_vgpu *__intel_gvt_create_vgpu(struct intel_gvt *gvt,
intel_gvt_debugfs_add_vgpu(vgpu);
- ret = intel_gvt_hypervisor_set_opregion(vgpu);
+ ret = intel_gvt_set_opregion(vgpu);
if (ret)
goto out_clean_sched_policy;
if (IS_BROADWELL(dev_priv) || IS_BROXTON(dev_priv))
- ret = intel_gvt_hypervisor_set_edid(vgpu, PORT_B);
+ ret = intel_gvt_set_edid(vgpu, PORT_B);
else
- ret = intel_gvt_hypervisor_set_edid(vgpu, PORT_D);
+ ret = intel_gvt_set_edid(vgpu, PORT_D);
if (ret)
goto out_clean_sched_policy;
Just call the code to setup the opregions and EDID data directly. Signed-off-by: Christoph Hellwig <hch@lst.de> --- drivers/gpu/drm/i915/gvt/gvt.h | 3 +++ drivers/gpu/drm/i915/gvt/hypercall.h | 3 --- drivers/gpu/drm/i915/gvt/kvmgt.c | 6 ++---- drivers/gpu/drm/i915/gvt/mpt.h | 32 ---------------------------- drivers/gpu/drm/i915/gvt/vgpu.c | 6 +++--- 5 files changed, 8 insertions(+), 42 deletions(-)