Android Graphic Stacks

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

  • All Android 3D apps and games have the following graphic stack:

Picture1.png

  • Android system UI and all Apps UI follow 2D graphic stack as below, the hardware render will accelerate Android 2D UI with GPU HW OpenGL-ES 2.0 to improve the whole UI performance.

New Picture.png

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

  • Surfaceflinger is responsible of all surface layers composition, and  then generate the framebuffer pixmap for display devices. these graphic surface layers are from 2D/3D apps.

New Picture (1).png

  • Hwcomposer is the alternative module of Surfaceflinger with OpenGL-ES. Hwcomposer is used to combine the specific surface layers supported by specific vendor devices. Freescale i.MX6 devices use GPU 2D to combine most surface layers, and the system power can be reduced with GPU 2D instead of GPU 3D. The typical power saving case is video playback.

 

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%.

New Picture (2).png

2. Performance measurment

  • Show FPS for Android system performance

 

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.

 

New Picture (3).png

  • Graphic benchmarks for 3D capability measurement

Quadrant

Full test benchmark cover CPU, Memory, IO, 2D and 3D

GLBenchmark

http://www.glbenchmark.com/

NenaMark2

https://market.android.com/details?id=se.nena.nenamark2

An3DBench

http://www.androidzoom.com/android_applications/tools/an3dbench_hnog.html

AnTutu

http://www.antutu.com/software.html

3DMark

http://www.futuremark.com/benchmarks/3dmark06/introduction/

  • Browser benchmarks

http://www.webkit.org/perf/sunspider/sunspider.html

http://v8.googlecode.com/svn/data/benchmarks/current/run.html

http://www.craftymind.com/guimark2/

http://www.craftymind.com/factory/guimark/GUIMark_HTML4.html

http://themaninblue.com/writing/perspective/2010/03/22/

 

3.  Android UI features

  • Dual display with same content

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.

  • Overscan for TV devices

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:

New Picture (4).png

  • 32 bits color depth

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)

 

New Picture (5).png

  • Display Visual Setting

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

New Picture (6).png

 

4. Issue Diagnosis

 

  • Application Compatibility

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.

 

  • GPU Compatibility

 

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.

 

  • Others

 

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.

  • simple_draw.zip 3.3 K No security policy violations found. The file was last scanned 5 months ago.
  • simple_draw_ics.tgz 7.4 K No security policy violations found. The file was last scanned 5 months ago.
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值