31
31
32
32
#include <drm/drm_crtc_helper.h>
33
33
#include <drm/drm_device.h>
34
- #include <drm/drm_irq .h>
34
+ #include <drm/drm_drv .h>
35
35
#include <drm/drm_probe_helper.h>
36
36
#include <drm/drm_vblank.h>
37
37
#include <drm/radeon_drm.h>
51
51
* radeon_irq_process is a macro that points to the per-asic
52
52
* irq handler callback.
53
53
*/
54
- irqreturn_t radeon_driver_irq_handler_kms (int irq , void * arg )
54
+ static irqreturn_t radeon_driver_irq_handler_kms (int irq , void * arg )
55
55
{
56
56
struct drm_device * dev = (struct drm_device * ) arg ;
57
57
struct radeon_device * rdev = dev -> dev_private ;
@@ -118,7 +118,7 @@ static void radeon_dp_work_func(struct work_struct *work)
118
118
* Gets the hw ready to enable irqs (all asics).
119
119
* This function disables all interrupt sources on the GPU.
120
120
*/
121
- void radeon_driver_irq_preinstall_kms (struct drm_device * dev )
121
+ static void radeon_driver_irq_preinstall_kms (struct drm_device * dev )
122
122
{
123
123
struct radeon_device * rdev = dev -> dev_private ;
124
124
unsigned long irqflags ;
@@ -150,7 +150,7 @@ void radeon_driver_irq_preinstall_kms(struct drm_device *dev)
150
150
* Handles stuff to be done after enabling irqs (all asics).
151
151
* Returns 0 on success.
152
152
*/
153
- int radeon_driver_irq_postinstall_kms (struct drm_device * dev )
153
+ static int radeon_driver_irq_postinstall_kms (struct drm_device * dev )
154
154
{
155
155
struct radeon_device * rdev = dev -> dev_private ;
156
156
@@ -169,7 +169,7 @@ int radeon_driver_irq_postinstall_kms(struct drm_device *dev)
169
169
*
170
170
* This function disables all interrupt sources on the GPU (all asics).
171
171
*/
172
- void radeon_driver_irq_uninstall_kms (struct drm_device * dev )
172
+ static void radeon_driver_irq_uninstall_kms (struct drm_device * dev )
173
173
{
174
174
struct radeon_device * rdev = dev -> dev_private ;
175
175
unsigned long irqflags ;
@@ -194,6 +194,36 @@ void radeon_driver_irq_uninstall_kms(struct drm_device *dev)
194
194
spin_unlock_irqrestore (& rdev -> irq .lock , irqflags );
195
195
}
196
196
197
+ static int radeon_irq_install (struct radeon_device * rdev , int irq )
198
+ {
199
+ struct drm_device * dev = rdev -> ddev ;
200
+ int ret ;
201
+
202
+ if (irq == IRQ_NOTCONNECTED )
203
+ return - ENOTCONN ;
204
+
205
+ radeon_driver_irq_preinstall_kms (dev );
206
+
207
+ /* PCI devices require shared interrupts. */
208
+ ret = request_irq (irq , radeon_driver_irq_handler_kms ,
209
+ IRQF_SHARED , dev -> driver -> name , dev );
210
+ if (ret )
211
+ return ret ;
212
+
213
+ radeon_driver_irq_postinstall_kms (dev );
214
+
215
+ return 0 ;
216
+ }
217
+
218
+ static void radeon_irq_uninstall (struct radeon_device * rdev )
219
+ {
220
+ struct drm_device * dev = rdev -> ddev ;
221
+ struct pci_dev * pdev = to_pci_dev (dev -> dev );
222
+
223
+ radeon_driver_irq_uninstall_kms (dev );
224
+ free_irq (pdev -> irq , dev );
225
+ }
226
+
197
227
/**
198
228
* radeon_msi_ok - asic specific msi checks
199
229
*
@@ -314,7 +344,7 @@ int radeon_irq_kms_init(struct radeon_device *rdev)
314
344
INIT_WORK (& rdev -> audio_work , r600_audio_update_hdmi );
315
345
316
346
rdev -> irq .installed = true;
317
- r = drm_irq_install (rdev -> ddev , rdev -> pdev -> irq );
347
+ r = radeon_irq_install (rdev , rdev -> pdev -> irq );
318
348
if (r ) {
319
349
rdev -> irq .installed = false;
320
350
flush_delayed_work (& rdev -> hotplug_work );
@@ -335,7 +365,7 @@ int radeon_irq_kms_init(struct radeon_device *rdev)
335
365
void radeon_irq_kms_fini (struct radeon_device * rdev )
336
366
{
337
367
if (rdev -> irq .installed ) {
338
- drm_irq_uninstall (rdev -> ddev );
368
+ radeon_irq_uninstall (rdev );
339
369
rdev -> irq .installed = false;
340
370
if (rdev -> msi_enabled )
341
371
pci_disable_msi (rdev -> pdev );
0 commit comments