MLK-17232-1: drm: imx: dcss: Fix context loader settings for LCD panel
authorLaurentiu Palcu <laurentiu.palcu@nxp.com>
Thu, 14 Dec 2017 13:35:02 +0000 (15:35 +0200)
committerLeonard Crestez <leonard.crestez@nxp.com>
Wed, 17 Apr 2019 23:51:34 +0000 (02:51 +0300)
If the vfront/vback porches are small are vsync length is small, the
dis_ulc_y is also small. Hence, the DB trigger setting will be
inappropriate and the DB context will not be able to load in time.

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

index 4e93083..f8f7b0e 100644 (file)
@@ -250,7 +250,12 @@ void dcss_dtg_sync_set(struct dcss_soc *dcss, struct videomode *vm)
        dtg->dis_ulc_x = dis_ulc_x;
        dtg->dis_ulc_y = dis_ulc_y;
 
-       dcss_dtg_write(dtg, dis_ulc_y, DCSS_DTG_TC_CTXLD);
+       /*
+        * If the dis_ulc_y is too small, then the context loader will not have
+        * time to load the DB context. This happens with LCD panels which have
+        * small vfront_porch, vback_porch and/or vsync_len.
+        */
+       dcss_dtg_write(dtg, dis_ulc_y < 50 ? 50 : dis_ulc_y, DCSS_DTG_TC_CTXLD);
 }
 EXPORT_SYMBOL(dcss_dtg_sync_set);