手上有多块屏 LVDS双通道, LVDS单通道, HDMI1980P,怎么说了,这个私活真的有点坑的,不过还好,做起来也容易
案例一 LVDS单通道
相信看过freescale驱动源码的都知道,显示这块支持好几种模式,下面贴一下代码
mxc_ipuv3_fb.c freescale GPU驱动文件
路径myandroid/kernel_imx/drivers/video/mxc/ldb.c里
/*
* "ldb=spl0/1" -- split mode on DI0/1
* "ldb=dul0/1" -- dual mode on DI0/1
* "ldb=sin0/1" -- single mode on LVDS0/1
* "ldb=sep0/1" -- separate mode begin from LVDS0/1
*
* there are two LVDS channels(LVDS0 and LVDS1) which can transfer video
* datas, there two channels can be used as split/dual/single/separate mode.
*
* split mode means display data from DI0 or DI1 will send to both channels
* LVDS0+LVDS1.
* dual mode means display data from DI0 or DI1 will be duplicated on LVDS0
* and LVDS1, it said, LVDS0 and LVDS1 has the same content.
* single mode means only work for DI0/DI1->LVDS0 or DI0/DI1->LVDS1.
* separate mode means you can make DI0/DI1->LVDS0 and DI0/DI1->LVDS1 work
* at the same time.
*/
好了,看了上面的支持的模式,对照手里的两块单通道和双通道的屏,还是一头雾水啊,找到了这个,可是分辨率怎么调整呢,没事我们一步一步来
接下来是要看一个结构体,相信大家都不陌生,在 myandroid/kernel_imx/include/linux/fb.h里有定义
struct fb_videomode {
const char *name; /* optional */
u32 refresh; /* optional */
u32 xres;
u32 yres;
u32 pixclock;
u32 left_margin;
u32 right_margin;
u32 upper_margin;
u32 lower_margin;
u32 hsync_len;
u32 vsync_len;
u32 sync;
u32 vmode;
u32 flag;
};
好了,我们根据具体的屏的参数将其对应的修改,
我这里单通道的屏分辨率是1024*768分辨率M121GNX2 R1
{
"LDB-1024P768", 60, 1024, 768, 15384,
100, 100,
12, 12,
120, 14,
FB_VMODE_NONINTERLACED,
FB_MODE_IS_DETAILED,
},
双通道的分辨率是1440*900 M190PW01 V8
{
"LDB-WXGA", 60, 1440, 900, 18868,
160, 160,
12, 10,
168, 10,
FB_SYNC_EXT,
FB_VMODE_NONINTERLACED,
0,},
{
"LDB-XGA", 60, 1440, 900, 18501,
220, 40,
21, 7,
60, 10,
FB_SYNC_EXT,
FB_VMODE_NONINTERLACED,
0,},
{
"LDB-1080P60", 60, 1440, 900, 18868,
160, 160,
12, 10,
168, 10,
FB_SYNC_EXT,
FB_VMODE_NONINTERLACED,
0,},
修改完以上的参数,剩下的就是要修改我们uboot启动时候传递的参数了,这个相信大家比我还熟悉,我就不用明说了
单通道显示的参数
U-Boot > setenv bootargs console=ttymxc0,115200 init=/init video=mxcfb0:dev=ldb,LDB-1024PP768,if=RGB18 ldb=sin0 video=mxcfb1:off video=mxcfb2:off fbmem=10M fb0base=0x27b00000 vmalloc=400M androidboot.console=ttymxc0 androidboot.hardware=freescale
双通道显示的参数
U-Boot > setenv bootargs console=ttymxc0,115200 init=/init video=mxcfb0:dev=ldb,LDB-XGA,if=RGB24 ldb=spl0 video=mxcfb1:off video=mxcfb2:off fbmem=10M fb0base=0x27b00000 vmalloc=400M androidboot.console=ttymxc0 androidboot.hardware=freescale
以上是LVDS的修改,接下来我们说一下HDMI的1080p的调试
其实方法差不多
/* #16: 1920x1080p@60Hz 16:9 */
100 [16] = {
101 NULL, 60, 1920, 1080, 6734, 148, 88, 36, 4, 44, 5,
102 FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT,
103 FB_VMODE_NONINTERLACED | FB_VMODE_ASPECT_16_9, 0,
104 },
U-Boot > setenv bootargs console=ttymxc0,115200 init=/init rw video=mxcfb0:dev=hdmi,1920x1080@60,bpp=25 video=mxcfb1:off video=mxcfb2:off fbmem=10M,28M vmalloc=512M androidboot.console=ttymxc0 androidboot.hardware=freescale
U-Boot > setenv bootargs console=ttymxc0,115200 init=/init rw video=mxcfb0:dev=hdmi,1920x1080@60,if=RGB32,bpp=32 video=mxcfb1:off video=mxcfb2:off fbmem=40M,68M vmalloc=512M androidboot.console=ttymxc0 androidboot.hardware=freescale
http://blog.csdn.net/xxu0123456789/article/details/45268309