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 (linux-sunxi 3.4.43 or later). 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 http://www.github.com/hglm/a10disp.git.

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
In some configurations turning the hardware scaler on or off in script.bin solves some issues.

More speciifcally. when driving a high bandwidth screen resolution (specifically 1920x1080 (1080p) with 32bpp at 60Hz) the Allwinner chip may sometimes be starved for memory bandwidth for refreshing the screen, especially if other components on the chip are utilizing a lot of memory bandwidth. The symptom is a "wavy screen" with most of the screen scanlines bouncing up and down quickly. This has been observed on an A10 in the Xorg environment (small bouncing), and on an A20 in X when running GLES accelerated Mali applications (heavy bouncing), especially with a large window size. Turning on "scaler mode" seems to solve the issue in both cases (sometimes it can be enough to lower the refresh rate, for example use 1080p at 50 Hz instead of 60 Hz). Scaler mode can be enabled by changing script.bin (fb0_scaler_mode_enable = 1) or using a runtime mode-setting utility such as [].

Driving LCDs
Tablet LCDs can generally may be made to work provided that the LCD parameters in script.bin are correct (http://linux-sunxi.org/Fex_Guide#lcd.5B0.2F1.5D_configuration). Usually these will be need to be obtained from the script.bin in Android's bootloader partition (/dev/block/nanda). Normally you would use Android's script.bin (converted to .fex) as a base and adopt it for linux-sunxi.

Tthe script.bin settings in the [disp_init] section (see http://linux-sunxi.org/Fex_Guide#disp_init_configuration) for Android tablets are usually configured to boot with screen0 on the LCD. A fex file configured to boot from LCD might like this:

[disp_init] disp_init_enable = 1 disp_mode = 0 screen0_output_type = 1 screen0_output_mode = 4 screen1_output_type = 1 screen1_output_mode = 4 fb0_framebuffer_num = 2 fb0_format = 10 fb0_pixel_sequence = 0 fb0_scaler_mode_enable = 0 fb0_width = 0 fb0_height = 0 fb1_framebuffer_num = 2 fb1_format = 10 fb1_pixel_sequence = 0 fb1_scaler_mode_enable = 0 fb1_width = 0 fb1_height = 0

screen0_output_type = 1 means LCD. The screen0_output_mode probably does not matter when the output type is LCD, since the LCD resolution is defined in the LCD parameter section.

Switching between LCD and HDMI at runtime works using a utility such as http://www.github.com/hgml/a10disp.git. Driving two screens (such as LCD and HDMI) at the same time (which the hardware supports) has not been extensively tested or verified.