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-05-01 17:43:25 +0100
commit666f176541445656a7dd3fd0b7cce067351a527f (patch)
treeda44b052a531154c4096590b66cb1cf954d8e72b
parent653c95327c0f07ea0467a7ccacead0924ec6b267 (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
*/