Lines Matching +full:irq +full:- +full:device
47 * radeon_driver_irq_handler_kms - irq handler for KMS
49 * This is the irq handler for the radeon KMS driver (all asics).
50 * radeon_irq_process is a macro that points to the per-asic
51 * irq handler callback.
53 static irqreturn_t radeon_driver_irq_handler_kms(int irq, void *arg) in radeon_driver_irq_handler_kms() argument
56 struct radeon_device *rdev = dev->dev_private; in radeon_driver_irq_handler_kms()
61 pm_runtime_mark_last_busy(dev->dev); in radeon_driver_irq_handler_kms()
69 * radeon_hotplug_work_func - display hotplug work handler
74 * The work gets scheduled from the irq handler if there
84 struct drm_mode_config *mode_config = &dev->mode_config; in radeon_hotplug_work_func()
89 if (!rdev->mode_info.mode_config_initialized) in radeon_hotplug_work_func()
92 mutex_lock(&mode_config->mutex); in radeon_hotplug_work_func()
93 list_for_each_entry(connector, &mode_config->connector_list, head) in radeon_hotplug_work_func()
95 mutex_unlock(&mode_config->mutex); in radeon_hotplug_work_func()
105 struct drm_mode_config *mode_config = &dev->mode_config; in radeon_dp_work_func()
108 mutex_lock(&mode_config->mutex); in radeon_dp_work_func()
109 list_for_each_entry(connector, &mode_config->connector_list, head) in radeon_dp_work_func()
111 mutex_unlock(&mode_config->mutex); in radeon_dp_work_func()
115 * radeon_driver_irq_preinstall_kms - drm irq preinstall callback
124 struct radeon_device *rdev = dev->dev_private; in radeon_driver_irq_preinstall_kms()
128 spin_lock_irqsave(&rdev->irq.lock, irqflags); in radeon_driver_irq_preinstall_kms()
131 atomic_set(&rdev->irq.ring_int[i], 0); in radeon_driver_irq_preinstall_kms()
132 rdev->irq.dpm_thermal = false; in radeon_driver_irq_preinstall_kms()
134 rdev->irq.hpd[i] = false; in radeon_driver_irq_preinstall_kms()
136 rdev->irq.crtc_vblank_int[i] = false; in radeon_driver_irq_preinstall_kms()
137 atomic_set(&rdev->irq.pflip[i], 0); in radeon_driver_irq_preinstall_kms()
138 rdev->irq.afmt[i] = false; in radeon_driver_irq_preinstall_kms()
141 spin_unlock_irqrestore(&rdev->irq.lock, irqflags); in radeon_driver_irq_preinstall_kms()
147 * radeon_driver_irq_postinstall_kms - drm irq preinstall callback
156 struct radeon_device *rdev = dev->dev_private; in radeon_driver_irq_postinstall_kms()
159 dev->max_vblank_count = 0x00ffffff; in radeon_driver_irq_postinstall_kms()
161 dev->max_vblank_count = 0x001fffff; in radeon_driver_irq_postinstall_kms()
167 * radeon_driver_irq_uninstall_kms - drm irq uninstall callback
175 struct radeon_device *rdev = dev->dev_private; in radeon_driver_irq_uninstall_kms()
182 spin_lock_irqsave(&rdev->irq.lock, irqflags); in radeon_driver_irq_uninstall_kms()
185 atomic_set(&rdev->irq.ring_int[i], 0); in radeon_driver_irq_uninstall_kms()
186 rdev->irq.dpm_thermal = false; in radeon_driver_irq_uninstall_kms()
188 rdev->irq.hpd[i] = false; in radeon_driver_irq_uninstall_kms()
190 rdev->irq.crtc_vblank_int[i] = false; in radeon_driver_irq_uninstall_kms()
191 atomic_set(&rdev->irq.pflip[i], 0); in radeon_driver_irq_uninstall_kms()
192 rdev->irq.afmt[i] = false; in radeon_driver_irq_uninstall_kms()
195 spin_unlock_irqrestore(&rdev->irq.lock, irqflags); in radeon_driver_irq_uninstall_kms()
198 static int radeon_irq_install(struct radeon_device *rdev, int irq) in radeon_irq_install() argument
203 if (irq == IRQ_NOTCONNECTED) in radeon_irq_install()
204 return -ENOTCONN; in radeon_irq_install()
209 ret = request_irq(irq, radeon_driver_irq_handler_kms, in radeon_irq_install()
210 IRQF_SHARED, dev->driver->name, dev); in radeon_irq_install()
222 struct pci_dev *pdev = to_pci_dev(dev->dev); in radeon_irq_uninstall()
225 free_irq(pdev->irq, dev); in radeon_irq_uninstall()
229 * radeon_msi_ok - asic specific msi checks
231 * @rdev: radeon device pointer
241 if (rdev->family < CHIP_RV380) in radeon_msi_ok()
245 if (rdev->flags & RADEON_IS_AGP) in radeon_msi_ok()
250 * of address for "64-bit" MSIs which breaks on some platforms, notably in radeon_msi_ok()
253 if (rdev->family < CHIP_BONAIRE) { in radeon_msi_ok()
254 dev_info(rdev->dev, "radeon: MSI limited to 32-bit\n"); in radeon_msi_ok()
255 rdev->pdev->no_64bit_msi = 1; in radeon_msi_ok()
266 if ((rdev->pdev->device == 0x791f) && in radeon_msi_ok()
267 (rdev->pdev->subsystem_vendor == 0x103c) && in radeon_msi_ok()
268 (rdev->pdev->subsystem_device == 0x30c2)) in radeon_msi_ok()
272 if ((rdev->pdev->device == 0x791f) && in radeon_msi_ok()
273 (rdev->pdev->subsystem_vendor == 0x1028) && in radeon_msi_ok()
274 (rdev->pdev->subsystem_device == 0x01fc)) in radeon_msi_ok()
278 if ((rdev->pdev->device == 0x791f) && in radeon_msi_ok()
279 (rdev->pdev->subsystem_vendor == 0x1028) && in radeon_msi_ok()
280 (rdev->pdev->subsystem_device == 0x01fd)) in radeon_msi_ok()
284 if ((rdev->pdev->device == 0x791f) && in radeon_msi_ok()
285 (rdev->pdev->subsystem_vendor == 0x107b) && in radeon_msi_ok()
286 (rdev->pdev->subsystem_device == 0x0185)) in radeon_msi_ok()
290 if (rdev->family == CHIP_RS690) in radeon_msi_ok()
297 if (rdev->family == CHIP_RV515) in radeon_msi_ok()
299 if (rdev->flags & RADEON_IS_IGP) { in radeon_msi_ok()
301 if (rdev->family >= CHIP_PALM) in radeon_msi_ok()
311 * radeon_irq_kms_init - init driver interrupt info
313 * @rdev: radeon device pointer
315 * Sets up the work irq handlers, vblank init, MSIs, etc. (all asics).
322 spin_lock_init(&rdev->irq.lock); in radeon_irq_kms_init()
324 /* Disable vblank irqs aggressively for power-saving */ in radeon_irq_kms_init()
325 rdev_to_drm(rdev)->vblank_disable_immediate = true; in radeon_irq_kms_init()
327 r = drm_vblank_init(rdev_to_drm(rdev), rdev->num_crtc); in radeon_irq_kms_init()
333 rdev->msi_enabled = 0; in radeon_irq_kms_init()
336 int ret = pci_enable_msi(rdev->pdev); in radeon_irq_kms_init()
338 rdev->msi_enabled = 1; in radeon_irq_kms_init()
339 dev_info(rdev->dev, "radeon: using MSI.\n"); in radeon_irq_kms_init()
343 INIT_DELAYED_WORK(&rdev->hotplug_work, radeon_hotplug_work_func); in radeon_irq_kms_init()
344 INIT_WORK(&rdev->dp_work, radeon_dp_work_func); in radeon_irq_kms_init()
345 INIT_WORK(&rdev->audio_work, r600_audio_update_hdmi); in radeon_irq_kms_init()
347 rdev->irq.installed = true; in radeon_irq_kms_init()
348 r = radeon_irq_install(rdev, rdev->pdev->irq); in radeon_irq_kms_init()
350 rdev->irq.installed = false; in radeon_irq_kms_init()
351 flush_delayed_work(&rdev->hotplug_work); in radeon_irq_kms_init()
355 DRM_INFO("radeon: irq initialized.\n"); in radeon_irq_kms_init()
360 * radeon_irq_kms_fini - tear down driver interrupt info
362 * @rdev: radeon device pointer
364 * Tears down the work irq handlers, vblank handlers, MSIs, etc. (all asics).
368 if (rdev->irq.installed) { in radeon_irq_kms_fini()
370 rdev->irq.installed = false; in radeon_irq_kms_fini()
371 if (rdev->msi_enabled) in radeon_irq_kms_fini()
372 pci_disable_msi(rdev->pdev); in radeon_irq_kms_fini()
373 flush_delayed_work(&rdev->hotplug_work); in radeon_irq_kms_fini()
378 * radeon_irq_kms_sw_irq_get - enable software interrupt
380 * @rdev: radeon device pointer
391 if (!rdev->irq.installed) in radeon_irq_kms_sw_irq_get()
394 if (atomic_inc_return(&rdev->irq.ring_int[ring]) == 1) { in radeon_irq_kms_sw_irq_get()
395 spin_lock_irqsave(&rdev->irq.lock, irqflags); in radeon_irq_kms_sw_irq_get()
397 spin_unlock_irqrestore(&rdev->irq.lock, irqflags); in radeon_irq_kms_sw_irq_get()
402 * radeon_irq_kms_sw_irq_get_delayed - enable software interrupt
404 * @rdev: radeon device pointer
413 return atomic_inc_return(&rdev->irq.ring_int[ring]) == 1; in radeon_irq_kms_sw_irq_get_delayed()
417 * radeon_irq_kms_sw_irq_put - disable software interrupt
419 * @rdev: radeon device pointer
430 if (!rdev->irq.installed) in radeon_irq_kms_sw_irq_put()
433 if (atomic_dec_and_test(&rdev->irq.ring_int[ring])) { in radeon_irq_kms_sw_irq_put()
434 spin_lock_irqsave(&rdev->irq.lock, irqflags); in radeon_irq_kms_sw_irq_put()
436 spin_unlock_irqrestore(&rdev->irq.lock, irqflags); in radeon_irq_kms_sw_irq_put()
441 * radeon_irq_kms_pflip_irq_get - enable pageflip interrupt
443 * @rdev: radeon device pointer
453 if (crtc < 0 || crtc >= rdev->num_crtc) in radeon_irq_kms_pflip_irq_get()
456 if (!rdev->irq.installed) in radeon_irq_kms_pflip_irq_get()
459 if (atomic_inc_return(&rdev->irq.pflip[crtc]) == 1) { in radeon_irq_kms_pflip_irq_get()
460 spin_lock_irqsave(&rdev->irq.lock, irqflags); in radeon_irq_kms_pflip_irq_get()
462 spin_unlock_irqrestore(&rdev->irq.lock, irqflags); in radeon_irq_kms_pflip_irq_get()
467 * radeon_irq_kms_pflip_irq_put - disable pageflip interrupt
469 * @rdev: radeon device pointer
479 if (crtc < 0 || crtc >= rdev->num_crtc) in radeon_irq_kms_pflip_irq_put()
482 if (!rdev->irq.installed) in radeon_irq_kms_pflip_irq_put()
485 if (atomic_dec_and_test(&rdev->irq.pflip[crtc])) { in radeon_irq_kms_pflip_irq_put()
486 spin_lock_irqsave(&rdev->irq.lock, irqflags); in radeon_irq_kms_pflip_irq_put()
488 spin_unlock_irqrestore(&rdev->irq.lock, irqflags); in radeon_irq_kms_pflip_irq_put()
493 * radeon_irq_kms_enable_afmt - enable audio format change interrupt
495 * @rdev: radeon device pointer
504 if (!rdev->irq.installed) in radeon_irq_kms_enable_afmt()
507 spin_lock_irqsave(&rdev->irq.lock, irqflags); in radeon_irq_kms_enable_afmt()
508 rdev->irq.afmt[block] = true; in radeon_irq_kms_enable_afmt()
510 spin_unlock_irqrestore(&rdev->irq.lock, irqflags); in radeon_irq_kms_enable_afmt()
515 * radeon_irq_kms_disable_afmt - disable audio format change interrupt
517 * @rdev: radeon device pointer
526 if (!rdev->irq.installed) in radeon_irq_kms_disable_afmt()
529 spin_lock_irqsave(&rdev->irq.lock, irqflags); in radeon_irq_kms_disable_afmt()
530 rdev->irq.afmt[block] = false; in radeon_irq_kms_disable_afmt()
532 spin_unlock_irqrestore(&rdev->irq.lock, irqflags); in radeon_irq_kms_disable_afmt()
536 * radeon_irq_kms_enable_hpd - enable hotplug detect interrupt
538 * @rdev: radeon device pointer
548 if (!rdev->irq.installed) in radeon_irq_kms_enable_hpd()
551 spin_lock_irqsave(&rdev->irq.lock, irqflags); in radeon_irq_kms_enable_hpd()
553 rdev->irq.hpd[i] |= !!(hpd_mask & (1 << i)); in radeon_irq_kms_enable_hpd()
555 spin_unlock_irqrestore(&rdev->irq.lock, irqflags); in radeon_irq_kms_enable_hpd()
559 * radeon_irq_kms_disable_hpd - disable hotplug detect interrupt
561 * @rdev: radeon device pointer
571 if (!rdev->irq.installed) in radeon_irq_kms_disable_hpd()
574 spin_lock_irqsave(&rdev->irq.lock, irqflags); in radeon_irq_kms_disable_hpd()
576 rdev->irq.hpd[i] &= !(hpd_mask & (1 << i)); in radeon_irq_kms_disable_hpd()
578 spin_unlock_irqrestore(&rdev->irq.lock, irqflags); in radeon_irq_kms_disable_hpd()
582 * radeon_irq_kms_set_irq_n_enabled - helper for updating interrupt enable registers
584 * @rdev: radeon device pointer