9 * This work is licensed under the terms of the GNU GPL, version 2 or later.
10 * See the COPYING file in the top-level directory.
14 #include "qemu/osdep.h"
15 #include "qapi/error.h"
16 #include "qemu/module.h"
17 #include "hw/pci/pci.h"
18 #include "hw/qdev-properties.h"
19 #include "hw/virtio/virtio.h"
20 #include "hw/virtio/virtio-bus.h"
21 #include "hw/virtio/virtio-gpu-pci.h"
22 #include "qom/object.h"
24 #define TYPE_VIRTIO_GPU_GL_PCI "virtio-gpu-gl-pci"
25 typedef struct VirtIOGPUGLPCI VirtIOGPUGLPCI
;
26 DECLARE_INSTANCE_CHECKER(VirtIOGPUGLPCI
, VIRTIO_GPU_GL_PCI
,
27 TYPE_VIRTIO_GPU_GL_PCI
)
29 struct VirtIOGPUGLPCI
{
30 VirtIOGPUPCIBase parent_obj
;
34 static void virtio_gpu_gl_initfn(Object
*obj
)
36 VirtIOGPUGLPCI
*dev
= VIRTIO_GPU_GL_PCI(obj
);
38 virtio_instance_init_common(obj
, &dev
->vdev
, sizeof(dev
->vdev
),
40 VIRTIO_GPU_PCI_BASE(obj
)->vgpu
= VIRTIO_GPU_BASE(&dev
->vdev
);
43 static const VirtioPCIDeviceTypeInfo virtio_gpu_gl_pci_info
= {
44 .generic_name
= TYPE_VIRTIO_GPU_GL_PCI
,
45 .parent
= TYPE_VIRTIO_GPU_PCI_BASE
,
46 .instance_size
= sizeof(VirtIOGPUGLPCI
),
47 .instance_init
= virtio_gpu_gl_initfn
,
50 static void virtio_gpu_gl_pci_register_types(void)
52 virtio_pci_types_register(&virtio_gpu_gl_pci_info
);
55 type_init(virtio_gpu_gl_pci_register_types
)