summaryrefslogtreecommitdiffstats
path: root/hw/display/virtio-vga.h
diff options
context:
space:
mode:
authorMarc-André Lureau2019-05-24 15:09:45 +0200
committerGerd Hoffmann2019-05-29 06:30:45 +0200
commitc68082c43a3ddeb5e5da4ab401e3f9f422e7a290 (patch)
treefc3536d2bbaa57cf0e1471ead1ce2f8fa13f06af /hw/display/virtio-vga.h
parentvirtio-gpu: split virtio-gpu, introduce virtio-gpu-base (diff)
downloadqemu-c68082c43a3ddeb5e5da4ab401e3f9f422e7a290.tar.gz
qemu-c68082c43a3ddeb5e5da4ab401e3f9f422e7a290.tar.xz
qemu-c68082c43a3ddeb5e5da4ab401e3f9f422e7a290.zip
virtio-gpu: split virtio-gpu-pci & virtio-vga
Add base classes that are common to vhost-user-gpu-pci and vhost-user-vga. Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Message-id: 20190524130946.31736-9-marcandre.lureau@redhat.com Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Diffstat (limited to 'hw/display/virtio-vga.h')
-rw-r--r--hw/display/virtio-vga.h32
1 files changed, 32 insertions, 0 deletions
diff --git a/hw/display/virtio-vga.h b/hw/display/virtio-vga.h
new file mode 100644
index 0000000000..f03e1ba619
--- /dev/null
+++ b/hw/display/virtio-vga.h
@@ -0,0 +1,32 @@
+#ifndef VIRTIO_VGA_H_
+#define VIRTIO_VGA_H_
+
+#include "hw/virtio/virtio-pci.h"
+#include "vga_int.h"
+
+/*
+ * virtio-vga-base: This extends VirtioPCIProxy.
+ */
+#define TYPE_VIRTIO_VGA_BASE "virtio-vga-base"
+#define VIRTIO_VGA_BASE(obj) \
+ OBJECT_CHECK(VirtIOVGABase, (obj), TYPE_VIRTIO_VGA_BASE)
+#define VIRTIO_VGA_BASE_GET_CLASS(obj) \
+ OBJECT_GET_CLASS(VirtIOVGABaseClass, obj, TYPE_VIRTIO_VGA_BASE)
+#define VIRTIO_VGA_BASE_CLASS(klass) \
+ OBJECT_CLASS_CHECK(VirtIOVGABaseClass, klass, TYPE_VIRTIO_VGA_BASE)
+
+typedef struct VirtIOVGABase {
+ VirtIOPCIProxy parent_obj;
+
+ VirtIOGPUBase *vgpu;
+ VGACommonState vga;
+ MemoryRegion vga_mrs[3];
+} VirtIOVGABase;
+
+typedef struct VirtIOVGABaseClass {
+ VirtioPCIClass parent_class;
+
+ DeviceReset parent_reset;
+} VirtIOVGABaseClass;
+
+#endif /* VIRTIO_VGA_H_ */