MLK-21656-2 drm/imx: dpu: crtc: Tune enablement sequence to correctly switch Tcon...
authorLiu Ying <victor.liu@nxp.com>
Tue, 7 May 2019 03:02:18 +0000 (11:02 +0800)
committerLiu Ying <victor.liu@nxp.com>
Fri, 10 May 2019 05:15:17 +0000 (13:15 +0800)
commitec323921dc2173128f071d0238e6439f5536aca1
treea2bcac996761a8f0115a0a0445a70d8cb5965c81
parent7d29b58e5a5ba3e696e7da0401f0a03f4cc38073
MLK-21656-2 drm/imx: dpu: crtc: Tune enablement sequence to correctly switch Tcon mode

As suggested by the design team, there is rigorous timing requirement
to address TKT320590, that is, we need to turn Tcon(s) from bypass mode
into operation mode as soon as the first dumb frame is generated by DPU.
When dual stream is used, we should look at the first dumb frame generated
by the master FrameGen.  If we cannot ensure the timing requirement, say
the Tcon mode switching takes place after the second frame is generated
by DPU, the hardware could run into malfunction sometimes.  Based on
stress tests, the content shadow load done event for the first time we call
->atomic_flush() may not come after the CRTC enablement in the single
stream case and it looks like display data is not generated to the
down-stream encoder(hence, black screen).  This patch tunes enablement
sequence to correctly switch Tcon mode, according to the design team's
suggestions.  During the switching, we don't relinquish CPU to ensure the
sequence is straightforward to meet the timing requirement.  As we cannot
sleep during the switching, we take the pixel link enablement/disablement
operations(wrapped by a mutex in RPC call) out of framegen_enable/disable()
functions and put them at appropriate place.  This introduces additional
sequence modifications but should be safe.

Signed-off-by: Liu Ying <victor.liu@nxp.com>
drivers/gpu/drm/imx/dpu/dpu-crtc.c
drivers/gpu/imx/dpu/dpu-framegen.c
include/video/dpu.h