summary refs log tree commit diff stats
path: root/hw/vfio/pci.h
diff options
context:
space:
mode:
authorTomita Moeko <tomitamoeko@gmail.com>2025-03-07 02:01:23 +0800
committerCédric Le Goater <clg@redhat.com>2025-03-11 17:01:14 +0100
commitae9d9ec4a643aae8704b4252b402488bde7b4be4 (patch)
treec4544aae4915f849a66c843dac89d86c671f278f /hw/vfio/pci.h
parent5faec6a5e2202d3460b6b0550ec4ad897be3c76f (diff)
downloadfocaccia-qemu-ae9d9ec4a643aae8704b4252b402488bde7b4be4.tar.gz
focaccia-qemu-ae9d9ec4a643aae8704b4252b402488bde7b4be4.zip
vfio/igd: Consolidate OpRegion initialization into a single function
Both x-igd-opregion option and legacy mode require identical steps to
set up OpRegion for IGD devices. Consolidate these steps into a single
vfio_pci_igd_setup_opregion function.

The function call in pci.c is wrapped with ifdef temporarily to prevent
build error for non-x86 archs, it will be removed after we decouple it
from legacy mode.

Additionally, move vfio_pci_igd_opregion_init to igd.c to prevent it
from being compiled in non-x86 builds.

Signed-off-by: Tomita Moeko <tomitamoeko@gmail.com>
Reviewed-by: Alex Williamson <alex.williamson@redhat.com>
Tested-by: Alex Williamson <alex.williamson@redhat.com>
Reviewed-by: Corvin Köhne <c.koehne@beckhoff.com>
Link: https://lore.kernel.org/qemu-devel/20250306180131.32970-4-tomitamoeko@gmail.com
[ clg: Fixed spelling in vfio_pci_igd_setup_opregion() ]
Signed-off-by: Cédric Le Goater <clg@redhat.com>
Diffstat (limited to 'hw/vfio/pci.h')
-rw-r--r--hw/vfio/pci.h4
1 files changed, 1 insertions, 3 deletions
diff --git a/hw/vfio/pci.h b/hw/vfio/pci.h
index d638c781f6..f660b0d80f 100644
--- a/hw/vfio/pci.h
+++ b/hw/vfio/pci.h
@@ -227,9 +227,7 @@ int vfio_pci_get_pci_hot_reset_info(VFIOPCIDevice *vdev,
 
 bool vfio_populate_vga(VFIOPCIDevice *vdev, Error **errp);
 
-bool vfio_pci_igd_opregion_init(VFIOPCIDevice *vdev,
-                                struct vfio_region_info *info,
-                                Error **errp);
+bool vfio_pci_igd_setup_opregion(VFIOPCIDevice *vdev, Error **errp);
 
 void vfio_display_reset(VFIOPCIDevice *vdev);
 bool vfio_display_probe(VFIOPCIDevice *vdev, Error **errp);