summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFancy Fang <chen.fang@nxp.com>2018-11-26 19:17:51 +0800
committerBryan O'Donoghue <bryan.odonoghue@linaro.org>2019-01-25 16:14:19 +0000
commitb6bd392d723c860d7c9007b4b35189a4edd77be6 (patch)
tree8fecd75df0b4544e30a158cee2d57e6d160cb403
parentf131cf2d26ade71d623b0f9a8d31d2746dc122c9 (diff)
MLK-20337 drm/imx: lcdif: block 'active CRTC with no plane' commit
When an atomic commit contains an active CRTC with no plane, it may cause two potential issues: First, this CRTC will fetch its last attached plane data or has no data can be fetched depending on the plane driver's atomic_disable() implementation. Second, this CRTC's 'plane_changed' will be false during the whole commit tail stage, and this will make vblank wait to be bypassed which directly causes the later wait flip done timeout. So add this commit case check to the LCDIF CRTC's atomic check to block this kind of commits. Signed-off-by: Fancy Fang <chen.fang@nxp.com> (cherry picked from commit 67ced65259a4dbf040ce4a931325be6ba97e5131)
-rw-r--r--drivers/gpu/drm/imx/lcdif/lcdif-crtc.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/gpu/drm/imx/lcdif/lcdif-crtc.c b/drivers/gpu/drm/imx/lcdif/lcdif-crtc.c
index 216baf13c3e0..9c7642e4a997 100644
--- a/drivers/gpu/drm/imx/lcdif/lcdif-crtc.c
+++ b/drivers/gpu/drm/imx/lcdif/lcdif-crtc.c
@@ -100,6 +100,13 @@ static int lcdif_crtc_atomic_check(struct drm_crtc *crtc,
if (!state->enable)
return 0;
+ /* For the commit that the CRTC is active
+ * without planes attached to it should be
+ * invalid.
+ */
+ if (state->active && !state->plane_mask)
+ return -EINVAL;
+
/* check the requested bus format can be
* supported by LCDIF CTRC or not
*/