drm/i915: Make prepare_plane_fb fully interruptible.
authorMaarten Lankhorst <maarten.lankhorst@linux.intel.com>
Wed, 23 Sep 2015 11:27:09 +0000 (13:27 +0200)
committerDaniel Vetter <daniel.vetter@ffwll.ch>
Mon, 19 Oct 2015 09:31:59 +0000 (11:31 +0200)
Now that we agreed on not preserving framebuffers pinning is finally
allowed to fail because of signals. Use this to make pinning
and acquire the mutex in an interruptible way too.

Unpinning is still uninterruptible, because it happens as a cleanup
of old state, or undoing pins after one of the pins failed.

The intel_pin_and_fence_fb_obj in page_flip will also wait interruptibly,
and can be aborted now.

Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Reviewed-by: Ander Conselvan de Oliveira <conselvan2@gmail.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
drivers/gpu/drm/i915/intel_display.c

index 8b98694896516a237e586d746bb6c7fc3777841f..95ea51f53a04a388538da60014a6c4738ce9cace 100644 (file)
@@ -2378,11 +2378,10 @@ intel_pin_and_fence_fb_obj(struct drm_plane *plane,
         */
        intel_runtime_pm_get(dev_priv);
 
-       dev_priv->mm.interruptible = false;
        ret = i915_gem_object_pin_to_display_plane(obj, alignment, pipelined,
                                                   pipelined_request, &view);
        if (ret)
-               goto err_interruptible;
+               goto err_pm;
 
        /* Install a fence for tiled scan-out. Pre-i965 always needs a
         * fence, whereas 965+ only requires a fence if using
@@ -2406,14 +2405,12 @@ intel_pin_and_fence_fb_obj(struct drm_plane *plane,
 
        i915_gem_object_pin_fence(obj);
 
-       dev_priv->mm.interruptible = true;
        intel_runtime_pm_put(dev_priv);
        return 0;
 
 err_unpin:
        i915_gem_object_unpin_from_display_plane(obj, &view);
-err_interruptible:
-       dev_priv->mm.interruptible = true;
+err_pm:
        intel_runtime_pm_put(dev_priv);
        return ret;
 }
@@ -13341,7 +13338,9 @@ intel_prepare_plane_fb(struct drm_plane *plane,
        if (!obj && !old_obj)
                return 0;
 
-       mutex_lock(&dev->struct_mutex);
+       ret = i915_mutex_lock_interruptible(dev);
+       if (ret)
+               return ret;
 
        if (!obj) {
                ret = 0;