drm/i915: Remove vma unpin in intel_plane_destroy
authorMaarten Lankhorst <maarten.lankhorst@linux.intel.com>
Thu, 11 May 2017 08:28:44 +0000 (10:28 +0200)
committerMaarten Lankhorst <maarten.lankhorst@linux.intel.com>
Thu, 11 May 2017 09:30:27 +0000 (11:30 +0200)
commit a667fb402c1e856209bf9e77ba41fc1cf356b867
Author: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Date:   Thu Dec 15 15:29:44 2016 +0100

    drm/i915: Disable all crtcs during driver unload, v2.

made sure that all crtc's are disabled on driver unload, but only the
following commit made sure all fb's are cleaned up correctly:

commit 9b2104f423de5c148749a07e8197dbab4c449877
Author: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Date:   Tue Feb 21 14:51:40 2017 +0100

    drm/atomic: Make disable_all helper fully disable the crtc.

Finally remove this and add a WARN_ON when vma is set. It should
have been removed by intel_cleanup_plane_fb().

Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/20170511082844.13965-2-maarten.lankhorst@linux.intel.com
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
drivers/gpu/drm/i915/intel_atomic_plane.c

index 182dc2a36ed1368028f4ef725ebbe3133a2a1d1a..4a0ed0278ae99702228e602cd642d20975232662 100644 (file)
@@ -102,23 +102,7 @@ void
 intel_plane_destroy_state(struct drm_plane *plane,
                          struct drm_plane_state *state)
 {
-       struct i915_vma *vma;
-
-       vma = fetch_and_zero(&to_intel_plane_state(state)->vma);
-
-       /*
-        * FIXME: Normally intel_cleanup_plane_fb handles destruction of vma.
-        * We currently don't clear all planes during driver unload, so we have
-        * to be able to unpin vma here for now.
-        *
-        * Normally this can only happen during unload when kmscon is disabled
-        * and userspace doesn't attempt to set a framebuffer at all.
-        */
-       if (vma) {
-               mutex_lock(&plane->dev->struct_mutex);
-               intel_unpin_fb_vma(vma);
-               mutex_unlock(&plane->dev->struct_mutex);
-       }
+       WARN_ON(to_intel_plane_state(state)->vma);
 
        drm_atomic_helper_plane_destroy_state(plane, state);
 }