diff options
author | Maarten Maathuis <madman2003@gmail.com> | 2010-02-01 14:58:27 -0500 |
---|---|---|
committer | Ben Skeggs <bskeggs@redhat.com> | 2010-02-25 00:07:53 -0500 |
commit | ff9e5279b14dc024599cc705ee199dadb94e90a3 (patch) | |
tree | 4881498b0c5f0defdc14890783249b0514a8afde /drivers/gpu/drm/nouveau/nouveau_irq.c | |
parent | 6c42966768b0254f465a8f451333795283f53d22 (diff) |
drm/nouveau: protect channel create/destroy and irq handler with a spinlock
The nv50 pgraph handler (for example) could reenable pgraph fifo access
and that would be bad when pgraph context is being unloaded (we need the
guarantee a ctxprog isn't running).
Signed-off-by: Maarten Maathuis <madman2003@gmail.com>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/nouveau/nouveau_irq.c')
-rw-r--r-- | drivers/gpu/drm/nouveau/nouveau_irq.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/gpu/drm/nouveau/nouveau_irq.c b/drivers/gpu/drm/nouveau/nouveau_irq.c index 447f9f69d6b1..95220ddebb45 100644 --- a/drivers/gpu/drm/nouveau/nouveau_irq.c +++ b/drivers/gpu/drm/nouveau/nouveau_irq.c | |||
@@ -691,11 +691,14 @@ nouveau_irq_handler(DRM_IRQ_ARGS) | |||
691 | struct drm_device *dev = (struct drm_device *)arg; | 691 | struct drm_device *dev = (struct drm_device *)arg; |
692 | struct drm_nouveau_private *dev_priv = dev->dev_private; | 692 | struct drm_nouveau_private *dev_priv = dev->dev_private; |
693 | uint32_t status, fbdev_flags = 0; | 693 | uint32_t status, fbdev_flags = 0; |
694 | unsigned long flags; | ||
694 | 695 | ||
695 | status = nv_rd32(dev, NV03_PMC_INTR_0); | 696 | status = nv_rd32(dev, NV03_PMC_INTR_0); |
696 | if (!status) | 697 | if (!status) |
697 | return IRQ_NONE; | 698 | return IRQ_NONE; |
698 | 699 | ||
700 | spin_lock_irqsave(&dev_priv->context_switch_lock, flags); | ||
701 | |||
699 | if (dev_priv->fbdev_info) { | 702 | if (dev_priv->fbdev_info) { |
700 | fbdev_flags = dev_priv->fbdev_info->flags; | 703 | fbdev_flags = dev_priv->fbdev_info->flags; |
701 | dev_priv->fbdev_info->flags |= FBINFO_HWACCEL_DISABLED; | 704 | dev_priv->fbdev_info->flags |= FBINFO_HWACCEL_DISABLED; |
@@ -733,5 +736,7 @@ nouveau_irq_handler(DRM_IRQ_ARGS) | |||
733 | if (dev_priv->fbdev_info) | 736 | if (dev_priv->fbdev_info) |
734 | dev_priv->fbdev_info->flags = fbdev_flags; | 737 | dev_priv->fbdev_info->flags = fbdev_flags; |
735 | 738 | ||
739 | spin_unlock_irqrestore(&dev_priv->context_switch_lock, flags); | ||
740 | |||
736 | return IRQ_HANDLED; | 741 | return IRQ_HANDLED; |
737 | } | 742 | } |