iMX6QD How to Add 24-bit LVDS Support in Android
iMX6QD How to Add 24-bit LVDS Support in Android
版本 4
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的更多相关文章
- Go support for Android
Go support for Android David Crawshaw June 2014 Abstract We propose to introduce Go support for the ...
- 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 ...
- ie-9 以下ajax无法跨域的问题。只要add:jQuery.support.cors=true;即可
if (!jQuery.support.cors && window.XDomainRequest) { var httpRegEx = /^https?:\/\//i; var ge ...
- 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 参考资 ...
- 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 ...
- 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 ...
- Android Meterial Design Support Library
extends:http://inthecheesefactory.com/blog/android-design-support-library-codelab At the moment I be ...
- 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 ...
- Material Design with the Android Design Support Library
Material Design with the Android Design Support Library 原文http://www.sitepoint.com/material-design-a ...
随机推荐
- Technocup 2017 - Elimination Round 1 (Unofficially Open for Everyone, Rated for Div. 2) B
Vasily exited from a store and now he wants to recheck the total price of all purchases in his bill. ...
- 关于foreach的一个BUG
foreach用起来比for更方便,但是foreach隐藏的操作,可能带来更多未知的BUG,今天就遇到一个问题.编程环境VS2010 //使用foreach遍历,其中未改变item的值,但是使用了匿名 ...
- centos安装openldap过程
1.下载软件如下,db是数据库 2.首先安装数据库db # tar xf db-4.8.30.tar.gz # cd db-4.8.30 # cd build_unix/ (# ../dist/con ...
- nodejs 学习(2) 中间件
var connect=require('connect'), morgan=require('morgan'),//日志 bodyparser=require('body-parser'), ses ...
- hdu 3686 Traffic Real Time Query System 点双两通分量 + LCA。这题有重边!!!
http://acm.hdu.edu.cn/showproblem.php?pid=3686 我要把这题记录下来. 一直wa. 自己生成数据都是AC的.现在还是wa.留坑. 我感觉我现在倒下去床上就能 ...
- asp.net中通过form表单submit提交到后台的实例
前台<body>中的代码: <body> <div id="top"> </div> <form id="login ...
- 基于Java实现的插入排序算法
简述 插入排序(Insertion-Sort)的算法描述是一种简单直观的排序算法.它的工作原理是通过构建有序序列,对于未排序数据,在已排序序列中从后向前扫描,找到相应位置并插入.插入排序在实现上,通常 ...
- 什么是OOA/OOD
Object Oriented Analyzing Object Oriented Design Object Oriented Programming ooa(object oriented ana ...
- WORD操作的问题
最近有个小项目主要是对文档,特别是WORD的操作,读取表格数据存到数据库: 再把数据库的数据读出来写入WORD,下载下来,诸如此类的东西,说来很是简单. 想了想是用什么开发呢? C#常用的,没话说,也 ...
- 获取SD卡下Android/data/下文件
通常情况下多数应用程序都会将缓存的位置选择为 /sdcard/Android/data/<application package>/cache 这个路径.选择在这个位置有两点好处:第一,这 ...