Lines Matching refs:irq

54 static irqreturn_t radeon_driver_irq_handler_kms(int irq, void *arg)  in radeon_driver_irq_handler_kms()  argument
119 spin_lock_irqsave(&rdev->irq.lock, irqflags); in radeon_driver_irq_preinstall_kms()
122 atomic_set(&rdev->irq.ring_int[i], 0); in radeon_driver_irq_preinstall_kms()
123 rdev->irq.dpm_thermal = false; in radeon_driver_irq_preinstall_kms()
125 rdev->irq.hpd[i] = false; in radeon_driver_irq_preinstall_kms()
127 rdev->irq.crtc_vblank_int[i] = false; in radeon_driver_irq_preinstall_kms()
128 atomic_set(&rdev->irq.pflip[i], 0); in radeon_driver_irq_preinstall_kms()
129 rdev->irq.afmt[i] = false; in radeon_driver_irq_preinstall_kms()
132 spin_unlock_irqrestore(&rdev->irq.lock, irqflags); in radeon_driver_irq_preinstall_kms()
173 spin_lock_irqsave(&rdev->irq.lock, irqflags); in radeon_driver_irq_uninstall_kms()
176 atomic_set(&rdev->irq.ring_int[i], 0); in radeon_driver_irq_uninstall_kms()
177 rdev->irq.dpm_thermal = false; in radeon_driver_irq_uninstall_kms()
179 rdev->irq.hpd[i] = false; in radeon_driver_irq_uninstall_kms()
181 rdev->irq.crtc_vblank_int[i] = false; in radeon_driver_irq_uninstall_kms()
182 atomic_set(&rdev->irq.pflip[i], 0); in radeon_driver_irq_uninstall_kms()
183 rdev->irq.afmt[i] = false; in radeon_driver_irq_uninstall_kms()
186 spin_unlock_irqrestore(&rdev->irq.lock, irqflags); in radeon_driver_irq_uninstall_kms()
189 static int radeon_irq_install(struct radeon_device *rdev, int irq) in radeon_irq_install() argument
194 if (irq == IRQ_NOTCONNECTED) in radeon_irq_install()
200 ret = request_irq(irq, radeon_driver_irq_handler_kms, in radeon_irq_install()
216 free_irq(pdev->irq, dev); in radeon_irq_uninstall()
313 spin_lock_init(&rdev->irq.lock); in radeon_irq_kms_init()
338 rdev->irq.installed = true; in radeon_irq_kms_init()
339 r = radeon_irq_install(rdev, rdev->pdev->irq); in radeon_irq_kms_init()
341 rdev->irq.installed = false; in radeon_irq_kms_init()
359 if (rdev->irq.installed) { in radeon_irq_kms_fini()
361 rdev->irq.installed = false; in radeon_irq_kms_fini()
382 if (!rdev->irq.installed) in radeon_irq_kms_sw_irq_get()
385 if (atomic_inc_return(&rdev->irq.ring_int[ring]) == 1) { in radeon_irq_kms_sw_irq_get()
386 spin_lock_irqsave(&rdev->irq.lock, irqflags); in radeon_irq_kms_sw_irq_get()
388 spin_unlock_irqrestore(&rdev->irq.lock, irqflags); in radeon_irq_kms_sw_irq_get()
404 return atomic_inc_return(&rdev->irq.ring_int[ring]) == 1; in radeon_irq_kms_sw_irq_get_delayed()
421 if (!rdev->irq.installed) in radeon_irq_kms_sw_irq_put()
424 if (atomic_dec_and_test(&rdev->irq.ring_int[ring])) { in radeon_irq_kms_sw_irq_put()
425 spin_lock_irqsave(&rdev->irq.lock, irqflags); in radeon_irq_kms_sw_irq_put()
427 spin_unlock_irqrestore(&rdev->irq.lock, irqflags); in radeon_irq_kms_sw_irq_put()
447 if (!rdev->irq.installed) in radeon_irq_kms_pflip_irq_get()
450 if (atomic_inc_return(&rdev->irq.pflip[crtc]) == 1) { in radeon_irq_kms_pflip_irq_get()
451 spin_lock_irqsave(&rdev->irq.lock, irqflags); in radeon_irq_kms_pflip_irq_get()
453 spin_unlock_irqrestore(&rdev->irq.lock, irqflags); in radeon_irq_kms_pflip_irq_get()
473 if (!rdev->irq.installed) in radeon_irq_kms_pflip_irq_put()
476 if (atomic_dec_and_test(&rdev->irq.pflip[crtc])) { in radeon_irq_kms_pflip_irq_put()
477 spin_lock_irqsave(&rdev->irq.lock, irqflags); in radeon_irq_kms_pflip_irq_put()
479 spin_unlock_irqrestore(&rdev->irq.lock, irqflags); in radeon_irq_kms_pflip_irq_put()
495 if (!rdev->irq.installed) in radeon_irq_kms_enable_afmt()
498 spin_lock_irqsave(&rdev->irq.lock, irqflags); in radeon_irq_kms_enable_afmt()
499 rdev->irq.afmt[block] = true; in radeon_irq_kms_enable_afmt()
501 spin_unlock_irqrestore(&rdev->irq.lock, irqflags); in radeon_irq_kms_enable_afmt()
517 if (!rdev->irq.installed) in radeon_irq_kms_disable_afmt()
520 spin_lock_irqsave(&rdev->irq.lock, irqflags); in radeon_irq_kms_disable_afmt()
521 rdev->irq.afmt[block] = false; in radeon_irq_kms_disable_afmt()
523 spin_unlock_irqrestore(&rdev->irq.lock, irqflags); in radeon_irq_kms_disable_afmt()
539 if (!rdev->irq.installed) in radeon_irq_kms_enable_hpd()
542 spin_lock_irqsave(&rdev->irq.lock, irqflags); in radeon_irq_kms_enable_hpd()
544 rdev->irq.hpd[i] |= !!(hpd_mask & (1 << i)); in radeon_irq_kms_enable_hpd()
546 spin_unlock_irqrestore(&rdev->irq.lock, irqflags); in radeon_irq_kms_enable_hpd()
562 if (!rdev->irq.installed) in radeon_irq_kms_disable_hpd()
565 spin_lock_irqsave(&rdev->irq.lock, irqflags); in radeon_irq_kms_disable_hpd()
567 rdev->irq.hpd[i] &= !(hpd_mask & (1 << i)); in radeon_irq_kms_disable_hpd()
569 spin_unlock_irqrestore(&rdev->irq.lock, irqflags); in radeon_irq_kms_disable_hpd()