Commit 19b7fc7b authored by Ben Skeggs's avatar Ben Skeggs

drm/nv50: use register/unregister functionality for PDISPLAY ISR

Reviewed-by: default avatarFrancisco Jerez <currojerez@riseup.net>
Signed-off-by: default avatarBen Skeggs <bskeggs@redhat.com>
parent 2cbd4c81
...@@ -38,10 +38,6 @@ ...@@ -38,10 +38,6 @@
#include "nouveau_ramht.h" #include "nouveau_ramht.h"
#include "nouveau_util.h" #include "nouveau_util.h"
/* needed for hotplug irq */
#include "nouveau_connector.h"
#include "nv50_display.h"
void void
nouveau_irq_preinstall(struct drm_device *dev) nouveau_irq_preinstall(struct drm_device *dev)
{ {
...@@ -50,12 +46,7 @@ nouveau_irq_preinstall(struct drm_device *dev) ...@@ -50,12 +46,7 @@ nouveau_irq_preinstall(struct drm_device *dev)
/* Master disable */ /* Master disable */
nv_wr32(dev, NV03_PMC_INTR_EN_0, 0); nv_wr32(dev, NV03_PMC_INTR_EN_0, 0);
if (dev_priv->card_type >= NV_50) {
INIT_WORK(&dev_priv->irq_work, nv50_display_irq_handler_bh);
INIT_WORK(&dev_priv->hpd_work, nv50_display_irq_hotplug_bh);
spin_lock_init(&dev_priv->hpd_state.lock);
INIT_LIST_HEAD(&dev_priv->vbl_waiting); INIT_LIST_HEAD(&dev_priv->vbl_waiting);
}
} }
int int
...@@ -1238,11 +1229,6 @@ nouveau_irq_handler(DRM_IRQ_ARGS) ...@@ -1238,11 +1229,6 @@ nouveau_irq_handler(DRM_IRQ_ARGS)
status &= ~NV_PMC_INTR_0_CRTCn_PENDING; status &= ~NV_PMC_INTR_0_CRTCn_PENDING;
} }
if (status & NV_PMC_INTR_0_NV50_DISPLAY_PENDING) {
nv50_display_irq_handler(dev);
status &= ~NV_PMC_INTR_0_NV50_DISPLAY_PENDING;
}
for (i = 0; i < 32 && status; i++) { for (i = 0; i < 32 && status; i++) {
if (!(status & (1 << i)) || !dev_priv->irq_handler[i]) if (!(status & (1 << i)) || !dev_priv->irq_handler[i])
continue; continue;
......
...@@ -33,6 +33,8 @@ ...@@ -33,6 +33,8 @@
#include "nouveau_ramht.h" #include "nouveau_ramht.h"
#include "drm_crtc_helper.h" #include "drm_crtc_helper.h"
static void nv50_display_isr(struct drm_device *);
static inline int static inline int
nv50_sor_nr(struct drm_device *dev) nv50_sor_nr(struct drm_device *dev)
{ {
...@@ -328,6 +330,9 @@ int nv50_display_create(struct drm_device *dev) ...@@ -328,6 +330,9 @@ int nv50_display_create(struct drm_device *dev)
} }
} }
INIT_WORK(&dev_priv->irq_work, nv50_display_irq_handler_bh);
nouveau_irq_register(dev, 26, nv50_display_isr);
ret = nv50_display_init(dev); ret = nv50_display_init(dev);
if (ret) { if (ret) {
nv50_display_destroy(dev); nv50_display_destroy(dev);
...@@ -345,6 +350,7 @@ nv50_display_destroy(struct drm_device *dev) ...@@ -345,6 +350,7 @@ nv50_display_destroy(struct drm_device *dev)
drm_mode_config_cleanup(dev); drm_mode_config_cleanup(dev);
nv50_display_disable(dev); nv50_display_disable(dev);
nouveau_irq_unregister(dev, 26);
} }
static u16 static u16
...@@ -863,8 +869,8 @@ nv50_display_irq_hotplug_bh(struct work_struct *work) ...@@ -863,8 +869,8 @@ nv50_display_irq_hotplug_bh(struct work_struct *work)
drm_helper_hpd_irq_event(dev); drm_helper_hpd_irq_event(dev);
} }
void static void
nv50_display_irq_handler(struct drm_device *dev) nv50_display_isr(struct drm_device *dev)
{ {
struct drm_nouveau_private *dev_priv = dev->dev_private; struct drm_nouveau_private *dev_priv = dev->dev_private;
uint32_t delayed = 0; uint32_t delayed = 0;
......
...@@ -35,7 +35,6 @@ ...@@ -35,7 +35,6 @@
#include "nouveau_crtc.h" #include "nouveau_crtc.h"
#include "nv50_evo.h" #include "nv50_evo.h"
void nv50_display_irq_handler(struct drm_device *dev);
void nv50_display_irq_handler_bh(struct work_struct *work); void nv50_display_irq_handler_bh(struct work_struct *work);
void nv50_display_irq_hotplug_bh(struct work_struct *work); void nv50_display_irq_hotplug_bh(struct work_struct *work);
int nv50_display_early_init(struct drm_device *dev); int nv50_display_early_init(struct drm_device *dev);
......
...@@ -26,6 +26,8 @@ ...@@ -26,6 +26,8 @@
#include "nouveau_drv.h" #include "nouveau_drv.h"
#include "nouveau_hw.h" #include "nouveau_hw.h"
#include "nv50_display.h"
static void nv50_gpio_isr(struct drm_device *dev); static void nv50_gpio_isr(struct drm_device *dev);
static int static int
...@@ -109,6 +111,8 @@ nv50_gpio_init(struct drm_device *dev) ...@@ -109,6 +111,8 @@ nv50_gpio_init(struct drm_device *dev)
nv_wr32(dev, 0xe074, 0xffffffff); nv_wr32(dev, 0xe074, 0xffffffff);
} }
INIT_WORK(&dev_priv->hpd_work, nv50_display_irq_hotplug_bh);
spin_lock_init(&dev_priv->hpd_state.lock);
nouveau_irq_register(dev, 21, nv50_gpio_isr); nouveau_irq_register(dev, 21, nv50_gpio_isr);
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment