diff options
author | Imre Deak <imre.deak@intel.com> | 2012-11-02 07:30:50 -0400 |
---|---|---|
committer | Inki Dae <daeinki@gmail.com> | 2012-11-29 06:30:34 -0500 |
commit | e7783ba3bf1c631278be6620875fbfa6b0eba905 (patch) | |
tree | 3dab1a45e1d504130bce9fdc60885aefe0700559 /drivers/gpu/drm/drm_irq.c | |
parent | 9fb7dff5ec238c8f71ef9b06256957a0db585c04 (diff) |
drm: hold event_lock while accessing vblank_event_list
Currently the only users of drm_vblank_off() are i915 and gma500,
neither of which holds the event_lock when calling this function.
Fix this by holding the event_lock while traversing the list.
Signed-off-by: Imre Deak <imre.deak@intel.com>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Diffstat (limited to 'drivers/gpu/drm/drm_irq.c')
-rw-r--r-- | drivers/gpu/drm/drm_irq.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/gpu/drm/drm_irq.c b/drivers/gpu/drm/drm_irq.c index 2ba9d7fac345..19c01ca3cc76 100644 --- a/drivers/gpu/drm/drm_irq.c +++ b/drivers/gpu/drm/drm_irq.c | |||
@@ -1021,6 +1021,8 @@ void drm_vblank_off(struct drm_device *dev, int crtc) | |||
1021 | 1021 | ||
1022 | /* Send any queued vblank events, lest the natives grow disquiet */ | 1022 | /* Send any queued vblank events, lest the natives grow disquiet */ |
1023 | seq = drm_vblank_count_and_time(dev, crtc, &now); | 1023 | seq = drm_vblank_count_and_time(dev, crtc, &now); |
1024 | |||
1025 | spin_lock(&dev->event_lock); | ||
1024 | list_for_each_entry_safe(e, t, &dev->vblank_event_list, base.link) { | 1026 | list_for_each_entry_safe(e, t, &dev->vblank_event_list, base.link) { |
1025 | if (e->pipe != crtc) | 1027 | if (e->pipe != crtc) |
1026 | continue; | 1028 | continue; |
@@ -1031,6 +1033,7 @@ void drm_vblank_off(struct drm_device *dev, int crtc) | |||
1031 | drm_vblank_put(dev, e->pipe); | 1033 | drm_vblank_put(dev, e->pipe); |
1032 | send_vblank_event(dev, e, seq, &now); | 1034 | send_vblank_event(dev, e, seq, &now); |
1033 | } | 1035 | } |
1036 | spin_unlock(&dev->event_lock); | ||
1034 | 1037 | ||
1035 | spin_unlock_irqrestore(&dev->vbl_lock, irqflags); | 1038 | spin_unlock_irqrestore(&dev->vbl_lock, irqflags); |
1036 | } | 1039 | } |