iMX6QD How to Add 24-bit LVDS Support in Android

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 [email protected] 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.

时间: 2024-10-03 06:40:27

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

Go support for Android

David Crawshaw June 2014 Abstract We propose to introduce Go support for the Android platform. The focus will be on supporting games written in Go. The APIs will be those defined in the Android NDK. Background Android is an operating system designed

Material Design with the Android Design Support Library

Material Design with the Android Design Support Library 原文http://www.sitepoint.com/material-design-android-design-support-library/ Material Design,Android 5.0发布时为android app 和其他平台app引入的一门新的设计语言. 它带来了一些新的UI组件,如“Floating Action Button”.实施这些新组件,同时确保向后兼容

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 Design anymore since it officially becomes a design philosophy by shaking the world of design in passed year. Surprisingly that it was not easy to implemen

Codelab for Android Design Support Library

extends:http://inthecheesefactory.com/blog/android-design-support-library-codelab At the moment I believe that there is no any Android Developer who doesn't know about Material Design anymore since it officially becomes a design philosophy by shaking

【翻】Android Design Support Library 的 代码实验——几行代码,让你的 APP 变得花俏

译者地址:[翻]Android Design Support Library 的 代码实验--几行代码,让你的 APP 变得花俏 原文:Codelab for Android Design Support Library used in I/O Rewind Bangkok session--Make your app fancy with few lines of code 原文项目 demo: Lab-Android-DesignLibrary 双语对照地址: [翻-双语]Android D

Android Design Support Library 的 代码实验——几行代码,让你的 APP 变得花俏

译者地址:[翻]Android Design Support Library 的 代码实验——几行代码,让你的 APP 变得花俏 原文:Codelab for Android Design Support Library used in I/O Rewind Bangkok session----Make your app fancy with few lines of code 原文项目 demo: Lab-Android-DesignLibrary 双语对照地址: [翻-双语]Android

【转】【翻】Android Design Support Library 的 代码实验——几行代码,让你的 APP 变得花俏

转自:http://mrfufufu.github.io/android/2015/07/01/Codelab_Android_Design_Support_Library.html [翻]Android Design Support Library 的 代码实验——几行代码,让你的 APP 变得花俏 Jul 1, 2015 译者地址:[翻]Android Design Support Library 的 代码实验——几行代码,让你的 APP 变得花俏 原文:Codelab for Androi

java 17 - 6 TreeSet集合及其add()方法的源码解析

TreeSet:能够对元素按照某种规则进行排序. 排序有两种方式 A:自然排序 B:比较器排序 TreeSet集合的特点:排序和唯一 1 public class TreeSetDemo { 2 public static void main(String[] args) { 3 // 创建集合对象 4 // 自然顺序进行排序 5 TreeSet<Integer> ts = new TreeSet<Integer>(); 6 7 // 创建元素并添加 8 // 20,18,23,2

From MSI to WiX, Part 2 - ARP support, by Alex Shevchuk

Following content is directly reprinted from From MSI to WiX, Part 2 - ARP support Author: Alex Shevchuk Adding Add/Remove Program (ARP) support Subset of properties stored in the Property table defines the information operating system will show in A