.. | .. |
---|
50 | 50 | * Zero on success, negative error code if failed |
---|
51 | 51 | */ |
---|
52 | 52 | static inline int intel_gvt_hypervisor_host_init(struct device *dev, |
---|
53 | | - void *gvt, const void *ops) |
---|
| 53 | + void *gvt, const void *ops) |
---|
54 | 54 | { |
---|
55 | | - /* optional to provide */ |
---|
56 | 55 | if (!intel_gvt_host.mpt->host_init) |
---|
57 | | - return 0; |
---|
| 56 | + return -ENODEV; |
---|
58 | 57 | |
---|
59 | 58 | return intel_gvt_host.mpt->host_init(dev, gvt, ops); |
---|
60 | 59 | } |
---|
.. | .. |
---|
62 | 61 | /** |
---|
63 | 62 | * intel_gvt_hypervisor_host_exit - exit GVT-g host side |
---|
64 | 63 | */ |
---|
65 | | -static inline void intel_gvt_hypervisor_host_exit(struct device *dev, |
---|
66 | | - void *gvt) |
---|
| 64 | +static inline void intel_gvt_hypervisor_host_exit(struct device *dev) |
---|
67 | 65 | { |
---|
68 | 66 | /* optional to provide */ |
---|
69 | 67 | if (!intel_gvt_host.mpt->host_exit) |
---|
70 | 68 | return; |
---|
71 | 69 | |
---|
72 | | - intel_gvt_host.mpt->host_exit(dev, gvt); |
---|
| 70 | + intel_gvt_host.mpt->host_exit(dev); |
---|
73 | 71 | } |
---|
74 | 72 | |
---|
75 | 73 | /** |
---|
.. | .. |
---|
101 | 99 | if (!intel_gvt_host.mpt->detach_vgpu) |
---|
102 | 100 | return; |
---|
103 | 101 | |
---|
104 | | - intel_gvt_host.mpt->detach_vgpu(vgpu->handle); |
---|
| 102 | + intel_gvt_host.mpt->detach_vgpu(vgpu); |
---|
105 | 103 | } |
---|
106 | 104 | |
---|
107 | 105 | #define MSI_CAP_CONTROL(offset) (offset + 2) |
---|
.. | .. |
---|
257 | 255 | } |
---|
258 | 256 | |
---|
259 | 257 | /** |
---|
| 258 | + * intel_gvt_hypervisor_dma_pin_guest_page - pin guest dma buf |
---|
| 259 | + * @vgpu: a vGPU |
---|
| 260 | + * @dma_addr: guest dma addr |
---|
| 261 | + * |
---|
| 262 | + * Returns: |
---|
| 263 | + * 0 on success, negative error code if failed. |
---|
| 264 | + */ |
---|
| 265 | +static inline int |
---|
| 266 | +intel_gvt_hypervisor_dma_pin_guest_page(struct intel_vgpu *vgpu, |
---|
| 267 | + dma_addr_t dma_addr) |
---|
| 268 | +{ |
---|
| 269 | + return intel_gvt_host.mpt->dma_pin_guest_page(vgpu->handle, dma_addr); |
---|
| 270 | +} |
---|
| 271 | + |
---|
| 272 | +/** |
---|
260 | 273 | * intel_gvt_hypervisor_map_gfn_to_mfn - map a GFN region to MFN |
---|
261 | 274 | * @vgpu: a vGPU |
---|
262 | 275 | * @gfn: guest PFN |
---|
.. | .. |
---|
316 | 329 | } |
---|
317 | 330 | |
---|
318 | 331 | /** |
---|
| 332 | + * intel_gvt_hypervisor_set_edid - Set EDID region for guest |
---|
| 333 | + * @vgpu: a vGPU |
---|
| 334 | + * @port_num: display port number |
---|
| 335 | + * |
---|
| 336 | + * Returns: |
---|
| 337 | + * Zero on success, negative error code if failed. |
---|
| 338 | + */ |
---|
| 339 | +static inline int intel_gvt_hypervisor_set_edid(struct intel_vgpu *vgpu, |
---|
| 340 | + int port_num) |
---|
| 341 | +{ |
---|
| 342 | + if (!intel_gvt_host.mpt->set_edid) |
---|
| 343 | + return 0; |
---|
| 344 | + |
---|
| 345 | + return intel_gvt_host.mpt->set_edid(vgpu, port_num); |
---|
| 346 | +} |
---|
| 347 | + |
---|
| 348 | +/** |
---|
319 | 349 | * intel_gvt_hypervisor_get_vfio_device - increase vfio device ref count |
---|
320 | 350 | * @vgpu: a vGPU |
---|
321 | 351 | * |
---|
.. | .. |
---|
362 | 392 | return intel_gvt_host.mpt->is_valid_gfn(vgpu->handle, gfn); |
---|
363 | 393 | } |
---|
364 | 394 | |
---|
| 395 | +int intel_gvt_register_hypervisor(struct intel_gvt_mpt *); |
---|
| 396 | +void intel_gvt_unregister_hypervisor(void); |
---|
| 397 | + |
---|
365 | 398 | #endif /* _GVT_MPT_H_ */ |
---|