iMX6QD How to Add 24-bit LVDS Support in Android

版本 4

由 Ying Liu 于 2012-10-14 下午11:52创建,最后由 Jodi Paul 于 2013-5-20 上午8:38修改。

Introduction

LVDS display panel driving data flow:

Display quality:

To get the best display quality for 24bit LVDS display panel in Android, we should use 32bit framebuffer, make IPUv3 display Engine and LDB output 24bit pixels, since RGB component information is aligned from source to destination.

2 stages to enable display:

Uboot splash screen and Kernel framebuffer

Guidelines

Uboot splash screen:

Change should be done in board file, like board/freescale/mx6q_sabresd/mx6q_sabresd.c:

1. Set video mode in struct fb_videomode according to the new 24bit LVDS display panel’s spec(please, refer to the example at the end of this doc).

2. Set up pwm, iomux/display related clock trees in lcd_enable(). Note that these should be aligned with Kernel settings to support smooth UI transition

from Uboot splash screen to Kernel framebuffer.

3. Set the output pixel format of IPUv3 display engine and LDB to IPU_PIX_FMT_RGB24 when calling ipuv3_fb_init().

4. Set pixel clock according to the new 24bit LVDS display panel’s spec when calling ipuv3_fb_init().

5. If dual LDB channels are needed to support tough display video mode(high resolution or high pixel clock frequency), we need to enable both of the two LDB

channels and set LDB to work at split mode. LDB_CTRL register should be set accordingly in lcd_enable().

Kernel framebuffer:

As we may add ‘video=‘  and ‘ldb=’ options in kernel bootup command line, Kernel code is more flexible to handle different LVDS display panels with various display color depth than Uboot code. For detail description of ‘video=’ and ‘ldb=’ option, please refer to MXC Linux BSP release notes and Android User Guide. Some known points are:

1. Add a video mode in struct fb_videomode in drivers/video/mxc/ldb.c according to the new 24bit LVDS display panel’s spec(please, refer to the example at

the end of this doc).

2. Set up pwm backlight/display related iomux in platform code.

3. Set appropriate ‘video=‘ option in kernel bootup command line, for example:

video=mxcfb0:dev=ldb,LDB-NEW,if=RGB24,fbpix=RGB32

4. Set appropriate ‘ldb=‘ option in kernel bootup command line if dual LDB channels are needed to support tough display video mode, for example:

ldb=spl0 (IPUv3 DI0 is used)  or  ldb=spl1 (IPUv3 DI1 is used)

5. Set appropriate ‘fbmem=‘ option in kernel bootup command line to reserve enough memory for framebuffer. For example, if we use 1280x800 LVDS panel

for fb0 and fb0 is in RGB32 pixel format, then ‘fbmem=12M’ should be used, since the formula is:

fbmem= width*height*3(triple buf)*Bytes_per_pixel= 1280*800*3*4B=12MB

An Example to Set struct fb_videomode:

Let’s take a look at the timing description quoted from a real 1280x800@60 24bit LVDS panel spec:

And, standard linux struct fb_videomode definition in 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;

};

What we need to do is to set every field of struct fb_videomode correctly according to the timing description of LVDS display panel’s spec:

1. name: we can set it to ‘LDB-WXGA’.

   2. refresh: though it’s optional, we can set it to typical value, that is, 60(60Hz refresh rate).

3. xres: the active width, that is, 1280.

   4. yres: the active height, that is, 800.

5. pixclock: calculate with this formula – pixclock=(10^12)/clk_freq. Here, typically, for this example, pixclock=(10^12)/71100000=14065.

   6. left_margin/right_margin/hsync_len:

They are the same to HS Back Porch(HBP)/HS Front Porch(HFP)/HS Width(HW) in the spec. Since the spec only tells us that typically

HBP+HFP+HW=160. We may set left_margin=40, right_margin=40, hsync_len=80.

   7. upper_margin/lower_margin/vsync_len:

Similar to horizontal timing, the vertical ones can be set to upper_margin=10, lower_margin=3, vsync_len=10.

  8. sync: Since the timing chart tells us that hsync/vsync are active low, so we don’t need to set FB_SYNC_HOR_HIGH_ACT or

FB_SYNC_VERT_HIGH_ACT. Moreover, clock polarity and data polarity are invalid, so we set sync to be zero here.

   9. vmode: this is a progressive video mode, so set vmode to FB_VMODE_NONINTERLACED.

10. flag: the video mode is provided by driver, so set flag to FB_MODE_IS_DETAILED.

iMX6QD How to Add 24-bit LVDS Support in Android的更多相关文章

  1. Go support for Android

    Go support for Android David Crawshaw June 2014 Abstract We propose to introduce Go support for the ...

  2. Why does eclipse automatically add appcompat v7 library support whenever I create a new project?

    Best ways to solve these: Firstly in project,Right click->properties->Android.There you can se ...

  3. ie-9 以下ajax无法跨域的问题。只要add:jQuery.support.cors=true;即可

    if (!jQuery.support.cors && window.XDomainRequest) { var httpRegEx = /^https?:\/\//i; var ge ...

  4. CentOS 6.7 中安装Emacs 24.5

    Emacs 版本:http://mirror.bjtu.edu.cn/gnu/emacs/emacs-24.5.tar.gz CentOS 内核版本:2.6.32-573.el6.x86_64 参考资 ...

  5. Codelab for Android Design Support Library used in I/O Rewind Bangkok session

    At the moment I believe that there is no any Android Developer who doesn't know about Material Desig ...

  6. Add Languages to Your Xamarin Apps with Multilingual App Toolkit

    With Xamarin, you can extend your cross-platform apps with support for native speakers, reaching mar ...

  7. Android Meterial Design Support Library

    extends:http://inthecheesefactory.com/blog/android-design-support-library-codelab At the moment I be ...

  8. FPGA LVDS I/O as an Analog Programmable Comparator

    http://www.eetimes.com/author.asp?section_id=36&doc_id=1320289 Seeing the new ADC IP being bandi ...

  9. Material Design with the Android Design Support Library

    Material Design with the Android Design Support Library 原文http://www.sitepoint.com/material-design-a ...

随机推荐

  1. zh-cn、en-us、zh-tw等表示语言(文化)代码与国家地区对照表(最全的各国地区对照表)

    af 公用荷兰语 af-ZA 公用荷兰语 - 南非 sq 阿尔巴尼亚 sq-AL 阿尔巴尼亚 -阿尔巴尼亚 ar 阿拉伯语 ar-DZ 阿拉伯语 -阿尔及利亚 ar-BH 阿拉伯语 -巴林 ar-EG ...

  2. Codeforces Round #532(Div. 2) C.NN and the Optical IIIusion

    链接:https://codeforces.com/contest/1100/problem/C 题意: 一个圆球外面由其他圆球包裹,两两相连. 给出n,r. n为外面圆球数量,r为内部圆球半径. 求 ...

  3. morhpia(4)-更新

    更新由2部分组成:一个查询和一组更新操作符.本例是跟所有薪水小于等于2000的员工涨工资500. @Test public void update() throws Exception { //第一步 ...

  4. Web Scalability for Startup Engineers Tip&Techniques for Scaling You Web Application --读书笔记

    Web Scalability for Startup Engineers Tip&Techniques for Scaling You Web Application 第1章和第2章讲述可伸 ...

  5. mysql 定时任务和存储过程

    mysql 定时任务和存储过程 最近在做日志系统,中间用到了 mysql, 其中有一个要求: 把数据库中 7天之后的日志清除了.看到 mysql 也支持 定时任务.于是就用 mysql 来做了.下面就 ...

  6. AJPFX关于collection总结

    Collection接口是该层次结构的根接口,该接口的所有子接口或实现子类集合都可以用Iterator迭代器进行取出.Collection有两个常见子接口,即为List和Set,其中List集合可以用 ...

  7. hasNextInt()方法

    hasNextInt()方法是判断控制台接收是否为数字,当你在控制台输入一个字符的时候,hasNextInt()判断你输入这个字符是不是数字,而不是接收值,当if判断通过之后执行接收,也就是你输入的那 ...

  8. How many '1's are there题解

    Description: Description: 第一行输入数字n(n<=50),表示有n组测试用例,第2到第n+1行每行输入数m(m为整数),统计并输出m用二进制表示时,1的个数. 例如:m ...

  9. WebService学习之旅(五)基于Apache Axis2发布第一个WebService

    上篇博文介绍了如何將axis2 webservice引擎安装到Web容器中,本节开始介绍如何基于apache axis2发布第一个简单的WebService. 一.WebService服务端发布步骤 ...

  10. Mybatis配置多数据源

    一. Spring配置多数据源 二. Spring配置数据源 三. MultipleDataSource的实现 1: package com.wbl.modal; 2:  3: import org. ...