Display

When you are using a ready made image for your device your display should be configured automatically.

In script.bin it is defined what display output is used and what hardware lines are used for connecting the output.

On kernel arguments you can specify the video mode used on the output or override autodetection on outputs that support EDID.

Framebuffer console at boot
To see boot traces you need to put all display related modules into kernel. CONFIG_FB_SUNXI=y CONFIG_FB_SUNXI_LCD=y CONFIG_FB_SUNXI_HDMI=y

CONFIG_FRAMEBUFFER_CONSOLE=y CONFIG_FONT_8x8=y CONFIG_FONT_8x16=y Then change u-boot config console=xxx parameter to tty0. If you want to still use a serial console you can define multiple consoles. For example "console=ttyS0,115200 console=tty0".

Changing resolution
The initial display resolution at boot time is defined in script.bin (fex-file), and can be overridden by kernel command line options.

But you can change it afterward by using this tool from doozan forum: http://forum.doozan.com/read.php?6,9002 https://github.com/doozan/a10-tools/blob/master/a10_display.c Tool changes display timings for wanted resolution. After that you'll need to set correct resolution with fbset -xres xxx -yres xxx

There is also a utility called a10disp that requires that version 1.0 or later of the sunxi kernel display driver is available. It can be used to show information about the current display mode, change the resolution and color depth of HDMI modes, and switch between LCD and HDMI output. It can be found at https://github.com/hglm/a10disp.

HDMI
If you are using a device with HDMI and have proper script.bin for your device setting up display is as simple as adding disp.screen0_output_mode=EDID to your kernel command line in boot.scr file. You can specify a fixed mode like disp.screen0_output_mode=1280x1024p60 or a fallback in case EDID did not work disp.screen0_output_mode=EDID:1280x1024p60. The supported fallback display modes are currently hardcoded in the disp driver. Looking at the clock table in https://github.com/linux-sunxi/linux-sunxi/blob/sunxi-3.0/drivers/video/sunxi/disp/disp_clk.c might be helpful.

boot.scr
setenv bootargs console=tty0 hdmi.audio=EDID:0 disp.screen0_output_mode=1280x720p60 root=/dev/mmcblk0p1 rootwait panic=10
 * 1) fixed mode

setenv bootargs console=tty0 hdmi.audio=EDID:0 disp.screen0_output_mode=EDID:1280x720p60 root=/dev/mmcblk0p1 rootwait panic=10
 * 1) try EDID first, if it did not work fallback to specific output mode

To generate a new boot.scr you need to edit boot.cmd file and then make a new boot.scr binary file.

mkimage -C none -A arm -T script -d  boot.scr

script.bin
Check these values in script.bin (you may need to remove the parts starting with semicolon):

[disp_init] disp_init_enable = 1 ; disp enabled? disp_mode = 0       ; ?? screen0_output_type = 3 ; HDMI screen0_output_mode = 4 ; this is somehow translated to actual video mode - use kernel arguments to set mode in more readable manner ; framebuffer 0 paramaters - same are used for framebuffer 1 fb0_framebuffer_num = 2 fb0_format = 10 fb0_pixel_sequence = 0 fb0_scaler_mode_enable = 0

See the Fex guide for a more detailed and up-to-date description.

LVDS
See: Cubieboard/LVDS

VGA
TBD

TV/CVBS
TBD

Using two displays
TBD

A10 has support for using two independent display outputs. Depending on board wiring and other hardware limitations not all output combinations may be possible.

Using hardware scaler
TBD

In some configurations turning the hardware scaler on or off in script.bin solves some issues.

Driving LCDs
TBD