summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/nouveau/nouveau_state.c
diff options
context:
space:
mode:
authorBen Skeggs2010-07-09 02:56:08 +0200
committerBen Skeggs2010-07-13 02:13:56 +0200
commite88efe056d308d0a3b6b645d0eec7236b2d8c902 (patch)
tree6b68d5cf5f349ebbeedbc3ecfd863a6e1afd9a3e /drivers/gpu/drm/nouveau/nouveau_state.c
parentdrm/nv50: move dp_set_tmds() function to happen in the last display irq (diff)
downloadkernel-qcow2-linux-e88efe056d308d0a3b6b645d0eec7236b2d8c902.tar.gz
kernel-qcow2-linux-e88efe056d308d0a3b6b645d0eec7236b2d8c902.tar.xz
kernel-qcow2-linux-e88efe056d308d0a3b6b645d0eec7236b2d8c902.zip
drm/nouveau: initialise display before enabling interrupts
In some situations it's possible we can receive a spurious hotplug IRQ before we're ready to handle it, leading to an oops. Calling the display init before enabling interrupts should clear any pending IRQs on the GPU and prevent this from happening. Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/nouveau/nouveau_state.c')
-rw-r--r--drivers/gpu/drm/nouveau/nouveau_state.c26
1 files changed, 13 insertions, 13 deletions
diff --git a/drivers/gpu/drm/nouveau/nouveau_state.c b/drivers/gpu/drm/nouveau/nouveau_state.c
index 67ee32fbba9d..c58ff9c48603 100644
--- a/drivers/gpu/drm/nouveau/nouveau_state.c
+++ b/drivers/gpu/drm/nouveau/nouveau_state.c
@@ -471,12 +471,19 @@ nouveau_card_init(struct drm_device *dev)
goto out_graph;
}
+ if (dev_priv->card_type >= NV_50)
+ ret = nv50_display_create(dev);
+ else
+ ret = nv04_display_create(dev);
+ if (ret)
+ goto out_fifo;
+
/* this call irq_preinstall, register irq handler and
* call irq_postinstall
*/
ret = drm_irq_install(dev);
if (ret)
- goto out_fifo;
+ goto out_display;
ret = drm_vblank_init(dev, 0);
if (ret)
@@ -490,13 +497,6 @@ nouveau_card_init(struct drm_device *dev)
goto out_irq;
}
- if (dev_priv->card_type >= NV_50)
- ret = nv50_display_create(dev);
- else
- ret = nv04_display_create(dev);
- if (ret)
- goto out_channel;
-
ret = nouveau_backlight_init(dev);
if (ret)
NV_ERROR(dev, "Error %d registering backlight\n", ret);
@@ -505,13 +505,13 @@ nouveau_card_init(struct drm_device *dev)
drm_kms_helper_poll_init(dev);
return 0;
-out_channel:
- if (dev_priv->channel) {
- nouveau_channel_free(dev_priv->channel);
- dev_priv->channel = NULL;
- }
out_irq:
drm_irq_uninstall(dev);
+out_display:
+ if (dev_priv->card_type >= NV_50)
+ nv50_display_destroy(dev);
+ else
+ nv04_display_destroy(dev);
out_fifo:
if (!nouveau_noaccel)
engine->fifo.takedown(dev);