MLK-17671-1: drm: imx: dcss: add a delay after changing the pixel clock
authorLaurentiu Palcu <laurentiu.palcu@nxp.com>
Tue, 6 Mar 2018 09:08:49 +0000 (11:08 +0200)
committerLeonard Crestez <leonard.crestez@nxp.com>
Wed, 17 Apr 2019 23:51:34 +0000 (02:51 +0300)
DCSS needs some time to stabilize after switching to a new pixel clock.
All interrupts will delayed till the clock stabilizes and we'll end up
getting warnings about VBLANK interrupt taking more than 50ms to arrive.

This patch adds a 500ms delay after switching to a new clock. This will
allow DCSS to stabilize before enabling CRTC and DTG channels.

Signed-off-by: Laurentiu Palcu <laurentiu.palcu@nxp.com>
drivers/gpu/imx/dcss/dcss-dtg.c

index 750baf7..418623b 100644 (file)
@@ -17,6 +17,7 @@
 #include <linux/io.h>
 #include <linux/clk.h>
 #include <linux/seq_file.h>
+#include <linux/delay.h>
 #include <drm/drm_fourcc.h>
 
 #include <video/imx-dcss.h>
@@ -241,6 +242,8 @@ void dcss_dtg_sync_set(struct dcss_soc *dcss, struct videomode *vm)
        clk_prepare_enable(dcss->pdiv_clk);
        clk_prepare_enable(dcss->pout_clk);
 
+       msleep(500);
+
        dcss_dtg_write(dtg, ((dtg_lrc_y << TC_Y_POS) | dtg_lrc_x),
                       DCSS_DTG_TC_DTG);
        dcss_dtg_write(dtg, ((dis_ulc_y << TC_Y_POS) | dis_ulc_x),