Skip to content

Commit

Permalink
drm/i915: wake up all pageflip waiters
Browse files Browse the repository at this point in the history
Otherwise it seems like we can get stuck with concurrent waiters.
Right now this /shouldn't/ be a problem, since all pending pageflip
waiters are serialized by the one mode_config.mutex, so there's at
most on waiter. But better paranoid than sorry, since this is tricky
code.

v2: WARN_ON(waitqueue_active) before waiting, as suggested by Chris
Wilson.

Acked-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
  • Loading branch information
Daniel Vetter committed Jan 17, 2013
1 parent b5cc6c0 commit 2c10d57
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion drivers/gpu/drm/i915/intel_display.c
Original file line number Diff line number Diff line change
Expand Up @@ -2220,6 +2220,8 @@ intel_finish_fb(struct drm_framebuffer *old_fb)
bool was_interruptible = dev_priv->mm.interruptible;
int ret;

WARN_ON(waitqueue_active(&dev_priv->pending_flip_queue));

wait_event(dev_priv->pending_flip_queue,
atomic_read(&dev_priv->mm.wedged) ||
atomic_read(&obj->pending_flip) == 0);
Expand Down Expand Up @@ -2887,6 +2889,8 @@ static void intel_crtc_wait_for_pending_flips(struct drm_crtc *crtc)
if (crtc->fb == NULL)
return;

WARN_ON(waitqueue_active(&dev_priv->pending_flip_queue));

wait_event(dev_priv->pending_flip_queue,
!intel_crtc_has_pending_flip(crtc));

Expand Down Expand Up @@ -6824,7 +6828,7 @@ static void do_intel_finish_page_flip(struct drm_device *dev,

obj = work->old_fb_obj;

wake_up(&dev_priv->pending_flip_queue);
wake_up_all(&dev_priv->pending_flip_queue);

queue_work(dev_priv->wq, &work->work);

Expand Down

0 comments on commit 2c10d57

Please sign in to comment.