Commit 907b5d6
Iouri Tarassov
drivers: hv: dxgkrnl: Driver initialization and creation of dxgadapter
- Add support for a Hyper-V based vGPU implementation that exposes the
DirectX API to Linux userspace.
- Handle driver loading, registration for the PCI and VM bus device
notifications
- Add headers for user mode interfaces, internal driver objects and VM bus
communication interface
- Handle initialization of VM bus channels and creation of the dxgadapter
object
- Removed dxg_copy_from_user and dxg_copy_to_user
- Connect the dxgkrnl module to the drivers/hv/ makefile and Kconfig.
- Create a MAINTAINERS entry
PCI driver registration
A PCI device is created for each virtual GPU (vGPU) device, projected by
the host. The device vendor is PCI_VENDOR_ID_MICROSOFT and device id is
PCI_DEVICE_ID_VIRTUAL_RENDER. dxg_pci_probe_device handles arrival of such
devices and it creates dxgadapter objects. The PCI config space of the
vGPU device has luid of the corresponding per GPU VM bus channel. This is
how the adapters are linked to VM bus channels.
dxgadapter initialization
A dxgadapter object represents a virtual GPU, projected to the VM by the
host. This object can start functioning only when the global VM bus
channel and the corresponding per vGPU VM bus channel are initialized in
the guest. Notifications about arrival of vGPU PCI device and VM bus
channels can happen in any order. Therefore, the initial dxgadapter object
state is DXGADAPTER_STATE_WAITING_VMBUS. A list of VM bus channels and a
list of dxgadapter objects are created. When dxgkrnl is notified about a
VM bus channel arrival, if tries to start all adapters, which are not
started yet.
VM bus interface version is exchanged by reading/writing the PCI config
space of the vGPU device.
Signed-off-by: Iouri Tarassov <iourit@linux.microsoft.com>1 parent 2c85ebc commit 907b5d6
18 files changed
Lines changed: 8308 additions & 0 deletions
File tree
- drivers/hv
- dxgkrnl
- include
- linux
- uapi/misc
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8190 | 8190 | | |
8191 | 8191 | | |
8192 | 8192 | | |
| 8193 | + | |
| 8194 | + | |
| 8195 | + | |
| 8196 | + | |
| 8197 | + | |
| 8198 | + | |
8193 | 8199 | | |
8194 | 8200 | | |
8195 | 8201 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
| 29 | + | |
| 30 | + | |
29 | 31 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| 5 | + | |
5 | 6 | | |
6 | 7 | | |
7 | 8 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
0 commit comments