LFU-156 video: mxsfb: Fix pixel clock issue in non-DM driver
authorYe Li <ye.li@nxp.com>
Mon, 31 May 2021 04:43:51 +0000 (21:43 -0700)
committerYe Li <ye.li@nxp.com>
Mon, 31 May 2021 06:16:50 +0000 (23:16 -0700)
When changing video mode to display timing structure, the pclk from
env or board codes is represented by the time of one clock (picosecond).
So we can't directly assign it to pixel clock (hz), but use PS2KHZ
to convert.

Signed-off-by: Ye Li <ye.li@nxp.com>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
drivers/video/mxsfb.c

index 722d1aa..4757f3e 100644 (file)
@@ -306,6 +306,9 @@ void *video_hw_init(void)
                bpp = depth;
        }
 
+       mode.pixclock_khz = PS2KHZ(mode.pixclock);
+       mode.pixclock = mode.pixclock_khz * 1000;
+
        if (CONFIG_IS_ENABLED(IMX_MODULE_FUSE)) {
                if (check_module_fused(MODULE_LCDIF)) {
                        printf("LCDIF@0x%x is fused, disable it\n", MXS_LCDIF_BASE);