intel-gfx.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] drm/i915: Make the lock for pageflips interruptible
@ 2012-05-23 10:13 Chris Wilson
  2012-07-15 11:06 ` Chris Wilson
  0 siblings, 1 reply; 3+ messages in thread
From: Chris Wilson @ 2012-05-23 10:13 UTC (permalink / raw)
  To: intel-gfx

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>
---
 drivers/gpu/drm/i915/intel_display.c |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index 198f46a..30dfa0d 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -6137,7 +6137,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);
@@ -6172,6 +6174,7 @@ cleanup_pending:
 	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);
-- 
1.7.10

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] drm/i915: Make the lock for pageflips interruptible
  2012-05-23 10:13 [PATCH] drm/i915: Make the lock for pageflips interruptible Chris Wilson
@ 2012-07-15 11:06 ` Chris Wilson
  2012-07-15 14:20   ` Daniel Vetter
  0 siblings, 1 reply; 3+ messages in thread
From: Chris Wilson @ 2012-07-15 11:06 UTC (permalink / raw)
  To: intel-gfx; +Cc: Daniel Vetter

On Wed, 23 May 2012 11:13:58 +0100, Chris Wilson <chris@chris-wilson.co.uk> wrote:
> 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.

Daniel?
-Chris

-- 
Chris Wilson, Intel Open Source Technology Centre

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] drm/i915: Make the lock for pageflips interruptible
  2012-07-15 11:06 ` Chris Wilson
@ 2012-07-15 14:20   ` Daniel Vetter
  0 siblings, 0 replies; 3+ messages in thread
From: Daniel Vetter @ 2012-07-15 14:20 UTC (permalink / raw)
  To: Chris Wilson; +Cc: Daniel Vetter, intel-gfx

On Sun, Jul 15, 2012 at 12:06:15PM +0100, Chris Wilson wrote:
> On Wed, 23 May 2012 11:13:58 +0100, Chris Wilson <chris@chris-wilson.co.uk> wrote:
> > 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.
> 
> Daniel?

Oops, I've totally missed this one. I think once the execbuffer fallout
for -ERESTARTSYS from intel_ring_begin has settled we should also look
into ditching the interruptible sections in our modeset code. Pageflip
should be rather simple, set_base should work, too, safe for the nasty
problem that we don't pass a sensible error code to the callers. But we
can fix that with the modeset rework. crtc mode_set is more work, but I
think when we move the fb pinning out of the ->modeset callbacks, this
should work, too.

In any case, thanks for the patch, merged to dinq.
-Daniel
-- 
Daniel Vetter
Mail: daniel@ffwll.ch
Mobile: +41 (0)79 365 57 48

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2012-07-15 14:20 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-05-23 10:13 [PATCH] drm/i915: Make the lock for pageflips interruptible Chris Wilson
2012-07-15 11:06 ` Chris Wilson
2012-07-15 14:20   ` Daniel Vetter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).