| #include "drmP.h" |
| #include "drm.h" |
| |
| #include "glint_drv.h" |
| #include "glint_family.h" |
| |
| #include "drm_pciids.h" |
| |
| static struct drm_driver driver; |
| |
| static struct pci_device_id pciidlist[] = { |
| glint_PCI_IDS |
| }; |
| |
| static int __devinit |
| glint_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent) |
| { |
| return drm_get_dev(pdev, ent, &driver); |
| } |
| |
| static void |
| glint_pci_remove(struct pci_dev *pdev) |
| { |
| struct drm_device *dev = pci_get_drvdata(pdev); |
| |
| drm_put_dev(dev); |
| } |
| |
| static struct drm_driver driver = { |
| .driver_features = DRIVER_MODESET, |
| .load = glint_driver_load, |
| .unload = glint_driver_unload, |
| .irq_preinstall = glint_driver_irq_preinstall, |
| .irq_postinstall = glint_driver_irq_postinstall, |
| .irq_uninstall = glint_driver_irq_uninstall, |
| .irq_handler = glint_driver_irq_handler, |
| .reclaim_buffers = drm_core_reclaim_buffers, |
| .get_map_ofs = drm_core_get_map_ofs, |
| .get_reg_ofs = drm_core_get_reg_ofs, |
| .ioctls = glint_ioctls, |
| .fops = { |
| .owner = THIS_MODULE, |
| .open = drm_open, |
| .release = drm_release, |
| .unlocked_ioctl = drm_ioctl, |
| .mmap = drm_mmap, |
| .poll = drm_poll, |
| .fasync = drm_fasync, |
| }, |
| .pci_driver = { |
| .name = DRIVER_NAME, |
| .id_table = pciidlist, |
| .probe = glint_pci_probe, |
| .remove = glint_pci_remove, |
| }, |
| |
| .name = DRIVER_NAME, |
| .desc = DRIVER_DESC, |
| .date = DRIVER_DATE, |
| .major = DRIVER_MAJOR, |
| .minor = DRIVER_MINOR, |
| .patchlevel = DRIVER_PATCHLEVEL, |
| }; |
| |
| static int __init |
| glint_init(void) |
| { |
| printk(KERN_INFO "Hello, GLint\n"); |
| driver.num_ioctls = glint_max_ioctl; |
| |
| return drm_init(&driver); |
| } |
| |
| static void __exit |
| glint_exit(void) |
| { |
| printk(KERN_INFO "Bye, GLint\n"); |
| drm_exit(&driver); |
| } |
| |
| module_init(glint_init); |
| module_exit(glint_exit); |
| |
| MODULE_AUTHOR(DRIVER_AUTHOR); |
| MODULE_DESCRIPTION(DRIVER_DESC); |
| MODULE_LICENSE("Dual MIT/GPL"); |