drm: Set the plane's crtc before calling disable_plane.
authorStéphane Marchesin <marcheu@chromium.org>
Thu, 4 Oct 2012 02:10:24 +0000 (19:10 -0700)
committerGerrit <chrome-bot@google.com>
Thu, 4 Oct 2012 06:32:26 +0000 (23:32 -0700)
Some drivers like exynos need the crtc to be able to disable the plane,
so set it before calling disable_plane.

BUG=chrome-os-partner:13583
TEST=by hand

Change-Id: I163584aede53eda82b4eabc28fa9253fd4551970
Reviewed-on: https://gerrit.chromium.org/gerrit/34597
Tested-by: Stéphane Marchesin <marcheu@chromium.org>
Reviewed-by: Anush Elangovan <anush@google.com>
Reviewed-by: Stéphane Marchesin <marcheu@chromium.org>
Commit-Ready: Stéphane Marchesin <marcheu@chromium.org>

drivers/gpu/drm/drm_crtc.c

index c79870a..c7ea0ef 100644 (file)
@@ -1713,14 +1713,6 @@ int drm_mode_setplane(struct drm_device *dev, void *data,
        }
        plane = obj_to_plane(obj);
 
-       /* No fb means shut it down */
-       if (!plane_req->fb_id) {
-               plane->funcs->disable_plane(plane);
-               plane->crtc = NULL;
-               plane->fb = NULL;
-               goto out;
-       }
-
        obj = drm_mode_object_find(dev, plane_req->crtc_id,
                                   DRM_MODE_OBJECT_CRTC);
        if (!obj) {
@@ -1731,6 +1723,15 @@ int drm_mode_setplane(struct drm_device *dev, void *data,
        }
        crtc = obj_to_crtc(obj);
 
+       /* No fb means shut it down */
+       if (!plane_req->fb_id) {
+               plane->crtc = crtc;
+               plane->funcs->disable_plane(plane);
+               plane->crtc = NULL;
+               plane->fb = NULL;
+               goto out;
+       }
+
        obj = drm_mode_object_find(dev, plane_req->fb_id,
                                   DRM_MODE_OBJECT_FB);
        if (!obj) {