Lines Matching defs:dev
69 static int drm_legacy_irq_install(struct drm_device *dev, int irq)
77 if (dev->irq_enabled)
79 dev->irq_enabled = true;
84 if (dev->driver->irq_preinstall)
85 dev->driver->irq_preinstall(dev);
88 if (dev_is_pci(dev->dev))
91 ret = request_irq(irq, dev->driver->irq_handler,
92 sh_flags, dev->driver->name, dev);
95 dev->irq_enabled = false;
100 if (dev->driver->irq_postinstall)
101 ret = dev->driver->irq_postinstall(dev);
104 dev->irq_enabled = false;
105 if (drm_core_check_feature(dev, DRIVER_LEGACY))
106 vga_client_unregister(to_pci_dev(dev->dev));
107 free_irq(irq, dev);
109 dev->irq = irq;
115 int drm_legacy_irq_uninstall(struct drm_device *dev)
121 irq_enabled = dev->irq_enabled;
122 dev->irq_enabled = false;
130 if (drm_dev_has_vblank(dev)) {
131 spin_lock_irqsave(&dev->vbl_lock, irqflags);
132 for (i = 0; i < dev->num_crtcs; i++) {
133 struct drm_vblank_crtc *vblank = &dev->vblank[i];
138 WARN_ON(drm_core_check_feature(dev, DRIVER_MODESET));
140 drm_vblank_disable_and_save(dev, i);
143 spin_unlock_irqrestore(&dev->vbl_lock, irqflags);
149 DRM_DEBUG("irq=%d\n", dev->irq);
151 if (drm_core_check_feature(dev, DRIVER_LEGACY))
152 vga_client_unregister(to_pci_dev(dev->dev));
154 if (dev->driver->irq_uninstall)
155 dev->driver->irq_uninstall(dev);
157 free_irq(dev->irq, dev);
163 int drm_legacy_irq_control(struct drm_device *dev, void *data,
174 if (!drm_core_check_feature(dev, DRIVER_HAVE_IRQ))
176 if (!drm_core_check_feature(dev, DRIVER_LEGACY))
179 if (WARN_ON(!dev_is_pci(dev->dev)))
184 pdev = to_pci_dev(dev->dev);
187 if (dev->if_version < DRM_IF_VERSION(1, 2) &&
190 mutex_lock(&dev->struct_mutex);
191 ret = drm_legacy_irq_install(dev, irq);
192 mutex_unlock(&dev->struct_mutex);
196 mutex_lock(&dev->struct_mutex);
197 ret = drm_legacy_irq_uninstall(dev);
198 mutex_unlock(&dev->struct_mutex);