Rev 2007 | Rev 2997 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 2007 | Rev 2160 | ||
---|---|---|---|
Line 32... | Line 32... | ||
32 | #include "radeon.h" |
32 | #include "radeon.h" |
33 | #include "atom.h" |
33 | #include "atom.h" |
Line 34... | Line 34... | ||
34 | 34 | ||
Line 35... | Line -... | ||
35 | struct radeon_device *main_device; |
- | |
36 | - | ||
37 | #if 0 |
- | |
38 | - | ||
39 | irqreturn_t radeon_driver_irq_handler_kms(DRM_IRQ_ARGS) |
- | |
40 | { |
- | |
41 | struct drm_device *dev = (struct drm_device *) arg; |
- | |
42 | struct radeon_device *rdev = dev->dev_private; |
35 | struct radeon_device *main_device; |
43 | - | ||
44 | return radeon_irq_process(rdev); |
- | |
45 | } |
- | |
46 | - | ||
47 | /* |
- | |
48 | * Handle hotplug events outside the interrupt handler proper. |
- | |
49 | */ |
- | |
50 | static void radeon_hotplug_work_func(struct work_struct *work) |
- | |
51 | { |
- | |
52 | struct radeon_device *rdev = container_of(work, struct radeon_device, |
- | |
53 | hotplug_work); |
- | |
54 | struct drm_device *dev = rdev->ddev; |
- | |
55 | struct drm_mode_config *mode_config = &dev->mode_config; |
- | |
56 | struct drm_connector *connector; |
- | |
57 | - | ||
58 | if (mode_config->num_connector) { |
- | |
59 | list_for_each_entry(connector, &mode_config->connector_list, head) |
- | |
60 | radeon_connector_hotplug(connector); |
- | |
61 | } |
- | |
62 | /* Just fire off a uevent and let userspace tell us what to do */ |
- | |
63 | drm_helper_hpd_irq_event(dev); |
- | |
64 | } |
- | |
65 | - | ||
66 | - | ||
67 | void radeon_driver_irq_uninstall_kms(struct drm_device *dev) |
- | |
68 | { |
- | |
69 | struct radeon_device *rdev = dev->dev_private; |
- | |
70 | unsigned i; |
- | |
71 | - | ||
72 | if (rdev == NULL) { |
- | |
73 | return; |
- | |
74 | } |
- | |
75 | /* Disable *all* interrupts */ |
- | |
76 | rdev->irq.sw_int = false; |
- | |
77 | rdev->irq.gui_idle = false; |
- | |
78 | for (i = 0; i < rdev->num_crtc; i++) |
- | |
79 | rdev->irq.crtc_vblank_int[i] = false; |
- | |
80 | for (i = 0; i < 6; i++) { |
- | |
81 | rdev->irq.hpd[i] = false; |
- | |
82 | rdev->irq.pflip[i] = false; |
- | |
83 | } |
- | |
84 | radeon_irq_set(rdev); |
- | |
85 | } |
- | |
Line 86... | Line 36... | ||
86 | 36 | ||
87 | #endif |
37 | extern int irq_override; |
88 | 38 | ||
89 | void irq_handler_kms() |
39 | void irq_handler_kms() |
Line 143... | Line 93... | ||
143 | rdev->irq.installed = true; |
93 | rdev->irq.installed = true; |
144 | main_device = rdev; |
94 | main_device = rdev; |
Line 145... | Line 95... | ||
145 | 95 | ||
Line -... | Line 96... | ||
- | 96 | radeon_irq_preinstall(rdev); |
|
- | 97 | ||
- | 98 | if (irq_override) |
|
146 | radeon_irq_preinstall(rdev); |
99 | irq_line = irq_override; |
Line 147... | Line 100... | ||
147 | 100 | else |
|
Line 148... | Line 101... | ||
148 | irq_line = rdev->pdev->irq; |
101 | irq_line = rdev->pdev->irq; |
Line 188... | Line 141... | ||
188 | radeon_irq_set(rdev); |
141 | radeon_irq_set(rdev); |
189 | } |
142 | } |
190 | spin_unlock_irqrestore(&rdev->irq.sw_lock, irqflags); |
143 | spin_unlock_irqrestore(&rdev->irq.sw_lock, irqflags); |
191 | } |
144 | }=>>>> |
Line 192... | Line -... | ||
192 | - | ||
193 | #if 0 |
- | |
194 | void radeon_irq_kms_pflip_irq_get(struct radeon_device *rdev, int crtc) |
- | |
195 | { |
- | |
196 | unsigned long irqflags; |
- | |
197 | - | ||
198 | if (crtc < 0 || crtc >= rdev->num_crtc) |
- | |
199 | return; |
- | |
200 | - | ||
201 | spin_lock_irqsave(&rdev->irq.pflip_lock[crtc], irqflags); |
- | |
202 | if (rdev->ddev->irq_enabled && (++rdev->irq.pflip_refcount[crtc] == 1)) { |
- | |
203 | rdev->irq.pflip[crtc] = true; |
- | |
204 | radeon_irq_set(rdev); |
- | |
205 | } |
- | |
206 | spin_unlock_irqrestore(&rdev->irq.pflip_lock[crtc], irqflags); |
- | |
207 | } |
- | |
208 | - | ||
209 | void radeon_irq_kms_pflip_irq_put(struct radeon_device *rdev, int crtc) |
- | |
210 | { |
- | |
211 | unsigned long irqflags; |
- | |
212 | - | ||
213 | if (crtc < 0 || crtc >= rdev->num_crtc) |
- | |
214 | return; |
- | |
215 | - | ||
216 | spin_lock_irqsave(&rdev->irq.pflip_lock[crtc], irqflags); |
- | |
217 | BUG_ON(rdev->ddev->irq_enabled && rdev->irq.pflip_refcount[crtc] <= 0); |
- | |
218 | if (rdev->ddev->irq_enabled && (--rdev->irq.pflip_refcount[crtc] == 0)) { |
- | |
219 | rdev->irq.pflip[crtc] = false; |
- | |
220 | radeon_irq_set(rdev); |
- | |
221 | } |
- | |
222 | spin_unlock_irqrestore(&rdev->irq.pflip_lock[crtc], irqflags); |
- | |
Line 223... | Line -... | ||
223 | } |
- |