@@ -43,7 +43,7 @@ static void virtio_gpu_pci_base_realize(VirtIOPCIProxy *vpci_dev, Error **errp)
PCI_BASE_ADDRESS_MEM_PREFETCH |
PCI_BASE_ADDRESS_MEM_TYPE_64,
&g->hostmem);
- virtio_pci_add_shm_cap(vpci_dev, 4, 0, g->conf.hostmem, 0);
+ virtio_pci_add_shm_cap(vpci_dev, 4, 0, g->conf.hostmem, VIRTIO_GPU_SHM_ID_HOST_VISIBLE);
}
qdev_set_parent_bus(vdev, BUS(&vpci_dev->bus), errp);
@@ -147,7 +147,7 @@ static void virtio_vga_base_realize(VirtIOPCIProxy *vpci_dev, Error **errp)
PCI_BASE_ADDRESS_MEM_PREFETCH |
PCI_BASE_ADDRESS_MEM_TYPE_64,
&g->hostmem);
- virtio_pci_add_shm_cap(vpci_dev, 4, 0, g->conf.hostmem, 0);
+ virtio_pci_add_shm_cap(vpci_dev, 4, 0, g->conf.hostmem, VIRTIO_GPU_SHM_ID_HOST_VISIBLE);
}
if (!(vpci_dev->flags & VIRTIO_PCI_FLAG_PAGE_PER_VQ)) {
@@ -1153,7 +1153,7 @@ int virtio_pci_add_shm_cap(VirtIOPCIProxy *proxy,
uint8_t bar, uint64_t offset, uint64_t length,
uint8_t id)
{
- struct virtio_pci_shm_cap cap = {
+ struct virtio_pci_cap64 cap = {
.cap.cap_len = sizeof cap,
.cap.cfg_type = VIRTIO_PCI_CAP_SHARED_MEMORY_CFG,
};
@@ -1164,7 +1164,7 @@ int virtio_pci_add_shm_cap(VirtIOPCIProxy *proxy,
cap.length_hi = cpu_to_le32((length >> 32) & mask32);
cap.cap.offset = cpu_to_le32(offset & mask32);
cap.offset_hi = cpu_to_le32((offset >> 32) & mask32);
- cap.id = id;
+ cap.cap.id = id;
return virtio_pci_add_mem_cap(proxy, &cap.cap);
}
@@ -172,13 +172,6 @@ struct virtio_pci_cfg_cap {
uint8_t pci_cfg_data[4]; /* Data for BAR access. */
};
-struct virtio_pci_shm_cap {
- struct virtio_pci_cap cap;
- uint32_t offset_hi; /* Most sig 32 bits of offset */
- uint32_t length_hi; /* Most sig 32 bits of length */
- uint8_t id; /* To distinguish shm chunks */
-};
-
/* Macro versions of offsets for the Old Timers! */
#define VIRTIO_PCI_CAP_VNDR 0
#define VIRTIO_PCI_CAP_NEXT 1
Use VIRTIO_GPU_SHM_ID_HOST_VISIBLE as id for virtio-gpu. Also, remove struct virtio_pci_shm_cap as virtio_pci_cap64 can be used instead. Signed-off-by: Antonio Caggiano <antonio.caggiano@collabora.com> --- hw/display/virtio-gpu-pci.c | 2 +- hw/display/virtio-vga.c | 2 +- hw/virtio/virtio-pci.c | 4 ++-- include/standard-headers/linux/virtio_pci.h | 7 ------- 4 files changed, 4 insertions(+), 11 deletions(-)