Imx6qd How to Add 24-bit LVDS support in Android

Source: Internet
Author: User

Imx6qd How to Add 24-bit LVDS support in Android

Version 4

Created by Ying Liu on 2012-10-14 11:52 and last modified by Jodi Paul in 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 on Android, we should use 32bit framebuffer, make IPUv3 displ Ay 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 is done with 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 (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 is aligned with Kernel settings to support smooth UI transition

From Uboot splash screens 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 is needed to support tough display video mode (high resolution or high pixel clock frequency), we Need to enable both of the both LDB

Channels and set LDB to work at split mode. Ldb_ctrl register should is set accordingly in Lcd_enable ().

Kernel framebuffer:

As we may add ' video= ' and ' ldb= ' options on kernel bootup command line, kernel code are 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 is:

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 (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 is needed to support tough display VI Deo 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 are in RGB32 pixel format, then ' fbmem=12m ' should was 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 structs 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 are to set every field of struct fb_videomode correctly according to the timing description of LVDS disp Lay 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, which is, 60Hz.

3. Xres:the active width, that's, a.

4. Yres:the active height, which 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 is 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 is set to upper_margin=10, Lower_margin=3, vsync_len=10.

8. Sync: Since The timing chart tells us that Hsync/vsync is active low, so we don ' t need to set Fb_sync_hor_h Igh_act or

Fb_sync_vert_high_act. Moreover, clock polarity and data polarity is invalid, so we set the sync to is zero here.

9. Vmode: A progressive video mode, so set Vmode to fb_vmode_noninterlaced.

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.