Graphics are a big topic in the Android platform, containing java/jni graphic framework and 2d/3d graphic engines (skia, OpenGL-ES, renderscript).
This document describes the general Android graphic stack and UI features on Freescale devices.
1. Android Graphic Stacks
Hardware acceleration can be disabled on i.mx6 in device/fsl/imx6/soc/imx6dq.mk
USE_OPENGL_RENDERER := false
Then rebuild frameworks/base/core/jni, and replace libandroid_runtime.so
Hwcomposer with GPU 2D can offload GPU 3D task when running game and benchmarks, it is proved to improve the overall system performance about 20%.
2. Performance measurment
For NFS boot you can set “debug.sf.showfps” to 1 in init.freescale.rc (“setprop debug.sf.showfps 1”) and then reboot the system. For SD or EMMC boot, you can issue command “setprop debug.sf.showfps 1” in console, then find system_server thread by top and kill it to reset the system.
Full test benchmark cover CPU, Memory, IO, 2D and 3D
3. Android UI features
This feature is supported in the default image in Android i.MX 6 release package. In this feature, LVDS panel and HDMI output can be supported simultaneously. It is only enabled when the HDMI TV has been connected with the board.
Some TVs may miss display the contents in overscan area. To avoid the contents in overscan area being lost, the common implement is by underscanning with an adjustable black border and letitng the viewer adjust the width of the black border. The downscan operation is done by surfaceflinger when it does surface composition through HW OpenGL ES. There is no performance impact since all the work is done by GPU HW. Overscan can be configured in display setting in visual mode:
32bpp UI can be supported by adding “bpp=32” in uboot as below:
setenv bootargs ‘… video=mxcdi1fb:RGB666,XGA,bpp=32 …’, also can configure it in display setting.
Enable 32bpp frame buffer and application surface buffer will be allocate to RGBA8888 format instead of default RGB565 format, that means more system memory is allocated.
After enabling 32bpp, if some applications still don't have better UI quality, check to see if there is hard code to request RGB565 format surface (should request RGBA8888 format to get better quality).
Sample code is attached to test for 32bpp (left is on 16bpp, right is on 32bpp)
The display setting is the add-on feature in FSL Android release, it is very convenient for end-users to change display property, mostly for the following features:
Dual display enablement
Display color depth setting(16bpp, 32bpp)
Overscan adjustment in horizontal and vertical orientation
4. Issue Diagnosis
Some Android applications may not run correctly on some Android releases. It may cause application compatibility, so check the application in other platforms.
For example Neocore and Asphalt 5 can run on Eclair, Froyo, and Gingerbread, but will not correctly run on Honeycomb.
Some game UIs may not correctly display on our Android release. When encountering this kind of issue, the customer can check whether it is caused by the game using an OpenGL extension which our GPU does not support. They can download another data package (for example not extension data package) to have a check.
Enlarge GPU memory if you encounter UI abnormally displaying after running an application for a while. Some applications need Wifi connections, so monitor the console log to see whether there are any error reports.