MLK-22597 drm/imx: dpu: kms: Allow primary plane on-the-fly disablement
authorLiu Ying <victor.liu@nxp.com>
Wed, 11 Sep 2019 21:06:23 +0000 (21:06 +0000)
committerLiu Ying <victor.liu@nxp.com>
Mon, 16 Sep 2019 07:14:07 +0000 (15:14 +0800)
By correcting plane's ExtDst source in ->atomic_begin() for
cases where pixel combiner is used, commit[1] acctually fixes
the primary plane on-the-fly disablement failure issue which
commit[2] tries to address.  So, let's revert commit[2] and
allow primary plane on-the-fly disablement.

[1] commit 2f3eaadf72c3 ("MLK-22584 drm/imx: dpu: crtc: Correct plane's ExtDst source in ->atomic_begin()")
[2] commit 6477bb1492b7 ("MLK-21525 drm/imx: dpu: kms: Disallow primary plane on-the-fly disablement")

Revert "MLK-21525 drm/imx: dpu: kms: Disallow primary plane on-the-fly disablement"

This reverts commit 6477bb1492b7ac89678891447f3d794e4fdb6df6.

Signed-off-by: Liu Ying <victor.liu@nxp.com>
(cherry picked from commit 148075a270dafa0a04f1c9b61d62e2764e469cf3)

drivers/gpu/drm/imx/dpu/dpu-kms.c

index a0ddf3d..ec94426 100644 (file)
@@ -517,40 +517,6 @@ dpu_atomic_put_possible_states_per_crtc(struct drm_crtc_state *crtc_state)
        dpu_atomic_put_crtc_state(state, crtc);
 }
 
-/* primary plane on-the-fly disablement? */
-static bool
-dpu_primary_plane_is_disabling_otf_per_crtc(struct drm_crtc_state *crtc_state)
-{
-       struct drm_atomic_state *state = crtc_state->state;
-       struct drm_plane *plane;
-       struct drm_plane_state *old_plane_state, *new_plane_state;
-       int i;
-
-       if (!crtc_state->enable)
-               return false;
-
-       if (drm_atomic_crtc_needs_modeset(crtc_state))
-               return false;
-
-       for_each_oldnew_plane_in_state(state, plane, old_plane_state,
-                                      new_plane_state, i) {
-               if (plane->type != DRM_PLANE_TYPE_PRIMARY)
-                       continue;
-
-               if (!old_plane_state->crtc)
-                       continue;
-
-               if (old_plane_state->crtc != crtc_state->crtc)
-                       continue;
-
-               if (drm_atomic_plane_disabling(old_plane_state,
-                                              new_plane_state))
-                       return true;
-       }
-
-       return false;
-}
-
 static int dpu_drm_atomic_check(struct drm_device *dev,
                                struct drm_atomic_state *state)
 {
@@ -610,10 +576,6 @@ static int dpu_drm_atomic_check(struct drm_device *dev,
                imx_crtc_state = to_imx_crtc_state(crtc_state);
                dcstate = to_dpu_crtc_state(imx_crtc_state);
 
-               /* disallow primary plane on-the-fly disablement */
-               if (dpu_primary_plane_is_disabling_otf_per_crtc(crtc_state))
-                       return -EINVAL;
-
                if (crtc_state->enable) {
                        if (use_pc[dpu_crtc->crtc_grp_id])
                                return -EINVAL;