首页 > 代码库 > imx6q 转换LVDS为VGA输出

imx6q 转换LVDS为VGA输出

我们使用ths8136 VGA编码器连接到imx6q的disp0_dat0 ~ dat23。当分辨率小于或等于720p图像质量好

然而如果解决方案是大于720p像素将运行100MHz的时钟。我们只需要修改 ipu_disp.c如下就可以解决:

uint32_t rounded_pixel_clk_upper, rounded_pixel_clk_lower;
...
if (rounded_pixel_clk < 100000000) {
rounded_pixel_clk_upper = pixel_clk + pixel_clk/200;
rounded_pixel_clk_lower = pixel_clk - pixel_clk/200;
} else {
rounded_pixel_clk_upper = pixel_clk + pixel_clk/50000;
rounded_pixel_clk_lower = pixel_clk - pixel_clk/50000;
}
if (!sig.int_clk && ((rounded_pixel_clk >= rounded_pixel_clk_upper) ||
(rounded_pixel_clk <= rounded_pixel_clk_lower))) {
dev_dbg(ipu->dev, "try ipu ext di clk\n");
...

然后在修改mxc_lcdif.c :
/* 800x480 @ 60 Hz , pixel clk @ 32MHz */
"SEIKO-WVGA", 60, 800, 480, 29850, 89, 164, 23, 10, 10, 10,
FB_SYNC_CLK_LAT_FALL,
FB_VMODE_NONINTERLACED,
0,},
{
/* 1280x1024 @ 60 Hz , pixel clk @ 108MHz */
"SXGA", 60, 1280, 1024, 9231, 48, 248, 1, 38, 112, 3,
FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT,
FB_VMODE_NONINTERLACED,
FB_MODE_IS_VESA},
{
/* 1920x1080 @ 60 Hz , pixel clk @ 148.5MHz */
"1080P60", 60, 1920, 1080, 7692, 136, 336, 3, 36, 200, 6,
FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT,
FB_VMODE_NONINTERLACED,
FB_MODE_IS_VESA},
{
/* 1920x1200 @ 60 Hz , pixel clk @ 193.16MHz */
"WUXGA", 60, 1920, 1200, 5175, 128, 336, 1, 38, 208, 3,
FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT,
FB_VMODE_NONINTERLACED,
FB_MODE_IS_VESA},

大功告成,开机设置完分辨率就可以正常显示了。

imx6q 转换LVDS为VGA输出