mdpy.c (f2fbc72e6da4f8e01fe5fe3d6871a791e76271c3) | mdpy.c (685a1537f4c603cfcaf4b9be56ff6a571f7ddd08) |
---|---|
1// SPDX-License-Identifier: GPL-2.0 2/* 3 * Mediated virtual PCI display host device driver 4 * 5 * See mdpy-defs.h for device specs 6 * 7 * (c) Gerd Hoffmann <kraxel@redhat.com> 8 * --- 647 unchanged lines hidden (view full) --- 656 .attrs = mdev_dev_attrs, 657}; 658 659static const struct attribute_group *mdev_dev_groups[] = { 660 &mdev_dev_group, 661 NULL, 662}; 663 | 1// SPDX-License-Identifier: GPL-2.0 2/* 3 * Mediated virtual PCI display host device driver 4 * 5 * See mdpy-defs.h for device specs 6 * 7 * (c) Gerd Hoffmann <kraxel@redhat.com> 8 * --- 647 unchanged lines hidden (view full) --- 656 .attrs = mdev_dev_attrs, 657}; 658 659static const struct attribute_group *mdev_dev_groups[] = { 660 &mdev_dev_group, 661 NULL, 662}; 663 |
664static ssize_t description_show(struct mdev_type *mtype, 665 struct mdev_type_attribute *attr, char *buf) | 664static ssize_t mdpy_show_description(struct mdev_type *mtype, char *buf) |
666{ 667 struct mdpy_type *type = container_of(mtype, struct mdpy_type, type); 668 669 return sprintf(buf, "virtual display, %dx%d framebuffer\n", 670 type->width, type->height); 671} | 665{ 666 struct mdpy_type *type = container_of(mtype, struct mdpy_type, type); 667 668 return sprintf(buf, "virtual display, %dx%d framebuffer\n", 669 type->width, type->height); 670} |
672static MDEV_TYPE_ATTR_RO(description); | |
673 674static unsigned int mdpy_get_available(struct mdev_type *mtype) 675{ 676 return max_devices - mdpy_count; 677} 678 | 671 672static unsigned int mdpy_get_available(struct mdev_type *mtype) 673{ 674 return max_devices - mdpy_count; 675} 676 |
679static const struct attribute *mdev_types_attrs[] = { 680 &mdev_type_attr_description.attr, 681 NULL, 682}; 683 | |
684static const struct vfio_device_ops mdpy_dev_ops = { 685 .init = mdpy_init_dev, 686 .release = mdpy_release_dev, 687 .read = mdpy_read, 688 .write = mdpy_write, 689 .ioctl = mdpy_ioctl, 690 .mmap = mdpy_mmap, 691}; --- 4 unchanged lines hidden (view full) --- 696 .name = "mdpy", 697 .owner = THIS_MODULE, 698 .mod_name = KBUILD_MODNAME, 699 .dev_groups = mdev_dev_groups, 700 }, 701 .probe = mdpy_probe, 702 .remove = mdpy_remove, 703 .get_available = mdpy_get_available, | 677static const struct vfio_device_ops mdpy_dev_ops = { 678 .init = mdpy_init_dev, 679 .release = mdpy_release_dev, 680 .read = mdpy_read, 681 .write = mdpy_write, 682 .ioctl = mdpy_ioctl, 683 .mmap = mdpy_mmap, 684}; --- 4 unchanged lines hidden (view full) --- 689 .name = "mdpy", 690 .owner = THIS_MODULE, 691 .mod_name = KBUILD_MODNAME, 692 .dev_groups = mdev_dev_groups, 693 }, 694 .probe = mdpy_probe, 695 .remove = mdpy_remove, 696 .get_available = mdpy_get_available, |
704 .types_attrs = mdev_types_attrs, | 697 .show_description = mdpy_show_description, |
705}; 706 707static const struct file_operations vd_fops = { 708 .owner = THIS_MODULE, 709}; 710 711static void mdpy_device_release(struct device *dev) 712{ --- 69 unchanged lines hidden --- | 698}; 699 700static const struct file_operations vd_fops = { 701 .owner = THIS_MODULE, 702}; 703 704static void mdpy_device_release(struct device *dev) 705{ --- 69 unchanged lines hidden --- |