Commit 92cc68e3 authored by Lyude Paul's avatar Lyude Paul

drm/vblank: Use spin_(un)lock_irq() in drm_crtc_vblank_on()

This is only called from:
* Atomic modesetting hooks
* Module probing routines
* Legacy modesetting hooks

All of which have IRQs enabled, so we can also get rid of
irqsave/restore here to make the IRQ context of this function more
obvious.
Signed-off-by: default avatarLyude Paul <lyude@redhat.com>
Cc: Daniel Vetter <daniel@ffwll.ch>
Link: https://patchwork.freedesktop.org/patch/msgid/20200720190736.180297-3-lyude@redhat.comReviewed-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
parent fbc678e8
...@@ -1428,12 +1428,11 @@ void drm_crtc_vblank_on(struct drm_crtc *crtc) ...@@ -1428,12 +1428,11 @@ void drm_crtc_vblank_on(struct drm_crtc *crtc)
struct drm_device *dev = crtc->dev; struct drm_device *dev = crtc->dev;
unsigned int pipe = drm_crtc_index(crtc); unsigned int pipe = drm_crtc_index(crtc);
struct drm_vblank_crtc *vblank = &dev->vblank[pipe]; struct drm_vblank_crtc *vblank = &dev->vblank[pipe];
unsigned long irqflags;
if (drm_WARN_ON(dev, pipe >= dev->num_crtcs)) if (drm_WARN_ON(dev, pipe >= dev->num_crtcs))
return; return;
spin_lock_irqsave(&dev->vbl_lock, irqflags); spin_lock_irq(&dev->vbl_lock);
drm_dbg_vbl(dev, "crtc %d, vblank enabled %d, inmodeset %d\n", drm_dbg_vbl(dev, "crtc %d, vblank enabled %d, inmodeset %d\n",
pipe, vblank->enabled, vblank->inmodeset); pipe, vblank->enabled, vblank->inmodeset);
...@@ -1451,7 +1450,7 @@ void drm_crtc_vblank_on(struct drm_crtc *crtc) ...@@ -1451,7 +1450,7 @@ void drm_crtc_vblank_on(struct drm_crtc *crtc)
*/ */
if (atomic_read(&vblank->refcount) != 0 || drm_vblank_offdelay == 0) if (atomic_read(&vblank->refcount) != 0 || drm_vblank_offdelay == 0)
drm_WARN_ON(dev, drm_vblank_enable(dev, pipe)); drm_WARN_ON(dev, drm_vblank_enable(dev, pipe));
spin_unlock_irqrestore(&dev->vbl_lock, irqflags); spin_unlock_irq(&dev->vbl_lock);
} }
EXPORT_SYMBOL(drm_crtc_vblank_on); EXPORT_SYMBOL(drm_crtc_vblank_on);
......
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