summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/imx
diff options
context:
space:
mode:
authorLaurentiu Palcu <laurentiu.palcu@nxp.com>2018-06-04 14:47:36 +0300
committerLeonard Crestez <leonard.crestez@nxp.com>2018-08-24 12:41:33 +0300
commit73d8c809ded8e4e00bd9e3f1f1183f51b3d014d7 (patch)
tree74365e99d4ccddfcee2a0ef1b6773c9715481989 /drivers/gpu/drm/imx
parent3b58b2de81fe59707480028bb801b0863adb85ec (diff)
MLK-17925: drm: imx: dcss: fix tearing
The video tearing appeared only when the application used 2 buffers. That's because, sometimes, the context loader could be armed after the DB event came in the frame trace. That made a buffer submitted in frame N end up on screen in frame N+2 because the context loader waits for the next DB event. Since vblank events are sent at the end of the frame, by the time the buffer lands on screen, the application will reuse it while it's being displayed, hence the tearing effect. This patch moves the CTXLD trigger moment all the way to the end of the frame trace, just before DB event arrives. This will leave the application plenty of time to submit new buffers. In the event that the trigger moment is missed (application submits a buffer right at the end of a frame trace), then we're not signalling the next VBLANK event to application. This way, application will know that the buffer is still needed and will not submit a new one. Signed-off-by: Laurentiu Palcu <laurentiu.palcu@nxp.com>
Diffstat (limited to 'drivers/gpu/drm/imx')
-rw-r--r--drivers/gpu/drm/imx/dcss/dcss-crtc.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/gpu/drm/imx/dcss/dcss-crtc.c b/drivers/gpu/drm/imx/dcss/dcss-crtc.c
index 1be7f1123697..272976844e1f 100644
--- a/drivers/gpu/drm/imx/dcss/dcss-crtc.c
+++ b/drivers/gpu/drm/imx/dcss/dcss-crtc.c
@@ -299,7 +299,8 @@ static irqreturn_t dcss_crtc_irq_handler(int irq, void *dev_id)
struct dcss_crtc *dcss_crtc = dev_id;
struct dcss_soc *dcss = dev_get_drvdata(dcss_crtc->dev->parent);
- drm_crtc_handle_vblank(&dcss_crtc->base);
+ if (dcss_ctxld_is_flushed(dcss))
+ drm_crtc_handle_vblank(&dcss_crtc->base);
dcss_vblank_irq_clear(dcss);