Lines Matching defs:rdev
38 struct radeon_device *rdev = dev->dev_private;
40 return radeon_irq_process(rdev);
48 struct radeon_device *rdev = container_of(work, struct radeon_device,
50 struct drm_device *dev = rdev->ddev;
64 struct radeon_device *rdev = dev->dev_private;
67 INIT_WORK(&rdev->hotplug_work, radeon_hotplug_work_func);
70 rdev->irq.sw_int = false;
71 rdev->irq.gui_idle = false;
72 for (i = 0; i < rdev->num_crtc; i++)
73 rdev->irq.crtc_vblank_int[i] = false;
75 rdev->irq.hpd[i] = false;
76 radeon_irq_set(rdev);
78 radeon_irq_process(rdev);
83 struct radeon_device *rdev = dev->dev_private;
86 rdev->irq.sw_int = true;
87 radeon_irq_set(rdev);
93 struct radeon_device *rdev = dev->dev_private;
96 if (rdev == NULL) {
100 rdev->irq.sw_int = false;
101 rdev->irq.gui_idle = false;
102 for (i = 0; i < rdev->num_crtc; i++)
103 rdev->irq.crtc_vblank_int[i] = false;
105 rdev->irq.hpd[i] = false;
106 radeon_irq_set(rdev);
109 int radeon_irq_kms_init(struct radeon_device *rdev)
113 spin_lock_init(&rdev->irq.sw_lock);
114 r = drm_vblank_init(rdev->ddev, rdev->num_crtc);
119 rdev->msi_enabled = 0;
123 if ((rdev->family >= CHIP_RV380) &&
124 (!(rdev->flags & RADEON_IS_IGP)) &&
125 (!(rdev->flags & RADEON_IS_AGP))) {
126 int ret = pci_enable_msi(rdev->pdev);
128 rdev->msi_enabled = 1;
129 dev_info(rdev->dev, "radeon: using MSI.\n");
132 rdev->irq.installed = true;
133 r = drm_irq_install(rdev->ddev);
135 rdev->irq.installed = false;
142 void radeon_irq_kms_fini(struct radeon_device *rdev)
144 drm_vblank_cleanup(rdev->ddev);
145 if (rdev->irq.installed) {
146 drm_irq_uninstall(rdev->ddev);
147 rdev->irq.installed = false;
148 if (rdev->msi_enabled)
149 pci_disable_msi(rdev->pdev);
153 void radeon_irq_kms_sw_irq_get(struct radeon_device *rdev)
157 spin_lock_irqsave(&rdev->irq.sw_lock, irqflags);
158 if (rdev->ddev->irq_enabled && (++rdev->irq.sw_refcount == 1)) {
159 rdev->irq.sw_int = true;
160 radeon_irq_set(rdev);
162 spin_unlock_irqrestore(&rdev->irq.sw_lock, irqflags);
165 void radeon_irq_kms_sw_irq_put(struct radeon_device *rdev)
169 spin_lock_irqsave(&rdev->irq.sw_lock, irqflags);
170 BUG_ON(rdev->ddev->irq_enabled && rdev->irq.sw_refcount <= 0);
171 if (rdev->ddev->irq_enabled && (--rdev->irq.sw_refcount == 0)) {
172 rdev->irq.sw_int = false;
173 radeon_irq_set(rdev);
175 spin_unlock_irqrestore(&rdev->irq.sw_lock, irqflags);