diff options
author | Ben Skeggs <bskeggs@redhat.com> | 2010-11-02 20:27:27 -0400 |
---|---|---|
committer | Ben Skeggs <bskeggs@redhat.com> | 2010-12-03 00:11:34 -0500 |
commit | 19b7fc7bf59f4bf02ee738a79baaccae31220df3 (patch) | |
tree | 55617722ed8d813156d385d241bbaf21b34f00e6 | |
parent | 2cbd4c818578ef8f2e486dc77267ead1e503c637 (diff) |
drm/nv50: use register/unregister functionality for PDISPLAY ISR
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
-rw-r--r-- | drivers/gpu/drm/nouveau/nouveau_irq.c | 16 | ||||
-rw-r--r-- | drivers/gpu/drm/nouveau/nv50_display.c | 10 | ||||
-rw-r--r-- | drivers/gpu/drm/nouveau/nv50_display.h | 1 | ||||
-rw-r--r-- | drivers/gpu/drm/nouveau/nv50_gpio.c | 4 |
4 files changed, 13 insertions, 18 deletions
diff --git a/drivers/gpu/drm/nouveau/nouveau_irq.c b/drivers/gpu/drm/nouveau/nouveau_irq.c index 061bae33b6e0..2f546884f2ed 100644 --- a/drivers/gpu/drm/nouveau/nouveau_irq.c +++ b/drivers/gpu/drm/nouveau/nouveau_irq.c | |||
@@ -38,10 +38,6 @@ | |||
38 | #include "nouveau_ramht.h" | 38 | #include "nouveau_ramht.h" |
39 | #include "nouveau_util.h" | 39 | #include "nouveau_util.h" |
40 | 40 | ||
41 | /* needed for hotplug irq */ | ||
42 | #include "nouveau_connector.h" | ||
43 | #include "nv50_display.h" | ||
44 | |||
45 | void | 41 | void |
46 | nouveau_irq_preinstall(struct drm_device *dev) | 42 | nouveau_irq_preinstall(struct drm_device *dev) |
47 | { | 43 | { |
@@ -50,12 +46,7 @@ nouveau_irq_preinstall(struct drm_device *dev) | |||
50 | /* Master disable */ | 46 | /* Master disable */ |
51 | nv_wr32(dev, NV03_PMC_INTR_EN_0, 0); | 47 | nv_wr32(dev, NV03_PMC_INTR_EN_0, 0); |
52 | 48 | ||
53 | if (dev_priv->card_type >= NV_50) { | 49 | INIT_LIST_HEAD(&dev_priv->vbl_waiting); |
54 | INIT_WORK(&dev_priv->irq_work, nv50_display_irq_handler_bh); | ||
55 | INIT_WORK(&dev_priv->hpd_work, nv50_display_irq_hotplug_bh); | ||
56 | spin_lock_init(&dev_priv->hpd_state.lock); | ||
57 | INIT_LIST_HEAD(&dev_priv->vbl_waiting); | ||
58 | } | ||
59 | } | 50 | } |
60 | 51 | ||
61 | int | 52 | int |
@@ -1238,11 +1229,6 @@ nouveau_irq_handler(DRM_IRQ_ARGS) | |||
1238 | status &= ~NV_PMC_INTR_0_CRTCn_PENDING; | 1229 | status &= ~NV_PMC_INTR_0_CRTCn_PENDING; |
1239 | } | 1230 | } |
1240 | 1231 | ||
1241 | if (status & NV_PMC_INTR_0_NV50_DISPLAY_PENDING) { | ||
1242 | nv50_display_irq_handler(dev); | ||
1243 | status &= ~NV_PMC_INTR_0_NV50_DISPLAY_PENDING; | ||
1244 | } | ||
1245 | |||
1246 | for (i = 0; i < 32 && status; i++) { | 1232 | for (i = 0; i < 32 && status; i++) { |
1247 | if (!(status & (1 << i)) || !dev_priv->irq_handler[i]) | 1233 | if (!(status & (1 << i)) || !dev_priv->irq_handler[i]) |
1248 | continue; | 1234 | continue; |
diff --git a/drivers/gpu/drm/nouveau/nv50_display.c b/drivers/gpu/drm/nouveau/nv50_display.c index 42cb5b5c73c0..e5dbd171672c 100644 --- a/drivers/gpu/drm/nouveau/nv50_display.c +++ b/drivers/gpu/drm/nouveau/nv50_display.c | |||
@@ -33,6 +33,8 @@ | |||
33 | #include "nouveau_ramht.h" | 33 | #include "nouveau_ramht.h" |
34 | #include "drm_crtc_helper.h" | 34 | #include "drm_crtc_helper.h" |
35 | 35 | ||
36 | static void nv50_display_isr(struct drm_device *); | ||
37 | |||
36 | static inline int | 38 | static inline int |
37 | nv50_sor_nr(struct drm_device *dev) | 39 | nv50_sor_nr(struct drm_device *dev) |
38 | { | 40 | { |
@@ -328,6 +330,9 @@ int nv50_display_create(struct drm_device *dev) | |||
328 | } | 330 | } |
329 | } | 331 | } |
330 | 332 | ||
333 | INIT_WORK(&dev_priv->irq_work, nv50_display_irq_handler_bh); | ||
334 | nouveau_irq_register(dev, 26, nv50_display_isr); | ||
335 | |||
331 | ret = nv50_display_init(dev); | 336 | ret = nv50_display_init(dev); |
332 | if (ret) { | 337 | if (ret) { |
333 | nv50_display_destroy(dev); | 338 | nv50_display_destroy(dev); |
@@ -345,6 +350,7 @@ nv50_display_destroy(struct drm_device *dev) | |||
345 | drm_mode_config_cleanup(dev); | 350 | drm_mode_config_cleanup(dev); |
346 | 351 | ||
347 | nv50_display_disable(dev); | 352 | nv50_display_disable(dev); |
353 | nouveau_irq_unregister(dev, 26); | ||
348 | } | 354 | } |
349 | 355 | ||
350 | static u16 | 356 | static u16 |
@@ -863,8 +869,8 @@ nv50_display_irq_hotplug_bh(struct work_struct *work) | |||
863 | drm_helper_hpd_irq_event(dev); | 869 | drm_helper_hpd_irq_event(dev); |
864 | } | 870 | } |
865 | 871 | ||
866 | void | 872 | static void |
867 | nv50_display_irq_handler(struct drm_device *dev) | 873 | nv50_display_isr(struct drm_device *dev) |
868 | { | 874 | { |
869 | struct drm_nouveau_private *dev_priv = dev->dev_private; | 875 | struct drm_nouveau_private *dev_priv = dev->dev_private; |
870 | uint32_t delayed = 0; | 876 | uint32_t delayed = 0; |
diff --git a/drivers/gpu/drm/nouveau/nv50_display.h b/drivers/gpu/drm/nouveau/nv50_display.h index c551f0b85ee0..a269fccf3555 100644 --- a/drivers/gpu/drm/nouveau/nv50_display.h +++ b/drivers/gpu/drm/nouveau/nv50_display.h | |||
@@ -35,7 +35,6 @@ | |||
35 | #include "nouveau_crtc.h" | 35 | #include "nouveau_crtc.h" |
36 | #include "nv50_evo.h" | 36 | #include "nv50_evo.h" |
37 | 37 | ||
38 | void nv50_display_irq_handler(struct drm_device *dev); | ||
39 | void nv50_display_irq_handler_bh(struct work_struct *work); | 38 | void nv50_display_irq_handler_bh(struct work_struct *work); |
40 | void nv50_display_irq_hotplug_bh(struct work_struct *work); | 39 | void nv50_display_irq_hotplug_bh(struct work_struct *work); |
41 | int nv50_display_early_init(struct drm_device *dev); | 40 | int nv50_display_early_init(struct drm_device *dev); |
diff --git a/drivers/gpu/drm/nouveau/nv50_gpio.c b/drivers/gpu/drm/nouveau/nv50_gpio.c index 302f7ebe5b6f..87266d1b5def 100644 --- a/drivers/gpu/drm/nouveau/nv50_gpio.c +++ b/drivers/gpu/drm/nouveau/nv50_gpio.c | |||
@@ -26,6 +26,8 @@ | |||
26 | #include "nouveau_drv.h" | 26 | #include "nouveau_drv.h" |
27 | #include "nouveau_hw.h" | 27 | #include "nouveau_hw.h" |
28 | 28 | ||
29 | #include "nv50_display.h" | ||
30 | |||
29 | static void nv50_gpio_isr(struct drm_device *dev); | 31 | static void nv50_gpio_isr(struct drm_device *dev); |
30 | 32 | ||
31 | static int | 33 | static int |
@@ -109,6 +111,8 @@ nv50_gpio_init(struct drm_device *dev) | |||
109 | nv_wr32(dev, 0xe074, 0xffffffff); | 111 | nv_wr32(dev, 0xe074, 0xffffffff); |
110 | } | 112 | } |
111 | 113 | ||
114 | INIT_WORK(&dev_priv->hpd_work, nv50_display_irq_hotplug_bh); | ||
115 | spin_lock_init(&dev_priv->hpd_state.lock); | ||
112 | nouveau_irq_register(dev, 21, nv50_gpio_isr); | 116 | nouveau_irq_register(dev, 21, nv50_gpio_isr); |
113 | return 0; | 117 | return 0; |
114 | } | 118 | } |