From: Liu Ying Date: Wed, 11 Sep 2019 21:06:23 +0000 (+0000) Subject: MLK-22597 drm/imx: dpu: kms: Allow primary plane on-the-fly disablement X-Git-Tag: rel_imx_4.19.35_1.1.0~51 X-Git-Url: https://git.somdevices.com/?a=commitdiff_plain;h=38ffd565ee39f8e8b5d2bbfc493e88c2c104c2c6;p=linux.git MLK-22597 drm/imx: dpu: kms: Allow primary plane on-the-fly disablement 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 (cherry picked from commit 148075a270dafa0a04f1c9b61d62e2764e469cf3) --- diff --git a/drivers/gpu/drm/imx/dpu/dpu-kms.c b/drivers/gpu/drm/imx/dpu/dpu-kms.c index a0ddf3de3809..ec94426ea6a3 100644 --- a/drivers/gpu/drm/imx/dpu/dpu-kms.c +++ b/drivers/gpu/drm/imx/dpu/dpu-kms.c @@ -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;