Skip to content

Commit

Permalink
drm/i915: Make the lock for pageflips interruptible
Browse files Browse the repository at this point in the history
As we take the struct_mutex lock to access the command-stream, there is
a possibility that we may need to wait for a GPU hang and so should make
the lock both interruptible and error-checking.

References: https://bugs.freedesktop.org/show_bug.cgi?id=50069
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
  • Loading branch information
Chris Wilson authored and Daniel Vetter committed Jul 20, 2012
1 parent a4f32fc commit 7915810
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion drivers/gpu/drm/i915/intel_display.c
Original file line number Diff line number Diff line change
Expand Up @@ -6486,7 +6486,9 @@ static int intel_crtc_page_flip(struct drm_crtc *crtc,
intel_fb = to_intel_framebuffer(fb);
obj = intel_fb->obj;

mutex_lock(&dev->struct_mutex);
ret = i915_mutex_lock_interruptible(dev);
if (ret)
goto cleanup;

/* Reference the objects for the scheduled work. */
drm_gem_object_reference(&work->old_fb_obj->base);
Expand Down Expand Up @@ -6521,6 +6523,7 @@ static int intel_crtc_page_flip(struct drm_crtc *crtc,
drm_gem_object_unreference(&obj->base);
mutex_unlock(&dev->struct_mutex);

cleanup:
spin_lock_irqsave(&dev->event_lock, flags);
intel_crtc->unpin_work = NULL;
spin_unlock_irqrestore(&dev->event_lock, flags);
Expand Down

0 comments on commit 7915810

Please sign in to comment.