mbochs.c (bdef2b7896df293736330eb6eb0f43947049b828) mbochs.c (89345d5177aa0f6d678251e1e0870b0eeb1ab510)
1// SPDX-License-Identifier: GPL-2.0
2/*
3 * Mediated virtual PCI display host device driver
4 *
5 * Emulate enough of qemu stdvga to make bochs-drm.ko happy. That is
6 * basically the vram memory bar and the bochs dispi interface vbe
7 * registers in the mmio register bar. Specifically it does *not*
8 * include any legacy vga stuff. Device looks a lot like "qemu -device

--- 114 unchanged lines hidden (view full) ---

123 },
124};
125
126
127static dev_t mbochs_devt;
128static struct class *mbochs_class;
129static struct cdev mbochs_cdev;
130static struct device mbochs_dev;
1// SPDX-License-Identifier: GPL-2.0
2/*
3 * Mediated virtual PCI display host device driver
4 *
5 * Emulate enough of qemu stdvga to make bochs-drm.ko happy. That is
6 * basically the vram memory bar and the bochs dispi interface vbe
7 * registers in the mmio register bar. Specifically it does *not*
8 * include any legacy vga stuff. Device looks a lot like "qemu -device

--- 114 unchanged lines hidden (view full) ---

123 },
124};
125
126
127static dev_t mbochs_devt;
128static struct class *mbochs_class;
129static struct cdev mbochs_cdev;
130static struct device mbochs_dev;
131static struct mdev_parent mbochs_parent;
131static atomic_t mbochs_avail_mbytes;
132static const struct vfio_device_ops mbochs_dev_ops;
133
134struct vfio_region_info_ext {
135 struct vfio_region_info base;
136 struct vfio_region_info_cap_type type;
137};
138

--- 1331 unchanged lines hidden (view full) ---

1470 mbochs_dev.class = mbochs_class;
1471 mbochs_dev.release = mbochs_device_release;
1472 dev_set_name(&mbochs_dev, "%s", MBOCHS_NAME);
1473
1474 ret = device_register(&mbochs_dev);
1475 if (ret)
1476 goto err_class;
1477
132static atomic_t mbochs_avail_mbytes;
133static const struct vfio_device_ops mbochs_dev_ops;
134
135struct vfio_region_info_ext {
136 struct vfio_region_info base;
137 struct vfio_region_info_cap_type type;
138};
139

--- 1331 unchanged lines hidden (view full) ---

1471 mbochs_dev.class = mbochs_class;
1472 mbochs_dev.release = mbochs_device_release;
1473 dev_set_name(&mbochs_dev, "%s", MBOCHS_NAME);
1474
1475 ret = device_register(&mbochs_dev);
1476 if (ret)
1477 goto err_class;
1478
1478 ret = mdev_register_device(&mbochs_dev, &mbochs_driver);
1479 ret = mdev_register_parent(&mbochs_parent, &mbochs_dev, &mbochs_driver);
1479 if (ret)
1480 goto err_device;
1481
1482 return 0;
1483
1484err_device:
1485 device_unregister(&mbochs_dev);
1486err_class:

--- 4 unchanged lines hidden (view full) ---

1491 cdev_del(&mbochs_cdev);
1492 unregister_chrdev_region(mbochs_devt, MINORMASK + 1);
1493 return ret;
1494}
1495
1496static void __exit mbochs_dev_exit(void)
1497{
1498 mbochs_dev.bus = NULL;
1480 if (ret)
1481 goto err_device;
1482
1483 return 0;
1484
1485err_device:
1486 device_unregister(&mbochs_dev);
1487err_class:

--- 4 unchanged lines hidden (view full) ---

1492 cdev_del(&mbochs_cdev);
1493 unregister_chrdev_region(mbochs_devt, MINORMASK + 1);
1494 return ret;
1495}
1496
1497static void __exit mbochs_dev_exit(void)
1498{
1499 mbochs_dev.bus = NULL;
1499 mdev_unregister_device(&mbochs_dev);
1500 mdev_unregister_parent(&mbochs_parent);
1500
1501 device_unregister(&mbochs_dev);
1502 mdev_unregister_driver(&mbochs_driver);
1503 cdev_del(&mbochs_cdev);
1504 unregister_chrdev_region(mbochs_devt, MINORMASK + 1);
1505 class_destroy(mbochs_class);
1506 mbochs_class = NULL;
1507}
1508
1509MODULE_IMPORT_NS(DMA_BUF);
1510module_init(mbochs_dev_init)
1511module_exit(mbochs_dev_exit)
1501
1502 device_unregister(&mbochs_dev);
1503 mdev_unregister_driver(&mbochs_driver);
1504 cdev_del(&mbochs_cdev);
1505 unregister_chrdev_region(mbochs_devt, MINORMASK + 1);
1506 class_destroy(mbochs_class);
1507 mbochs_class = NULL;
1508}
1509
1510MODULE_IMPORT_NS(DMA_BUF);
1511module_init(mbochs_dev_init)
1512module_exit(mbochs_dev_exit)