sgx530上的eglSwapBuffer是慢的

时间:2022-03-01 18:59:37

We have an embedded system that uses TI 8168 based h/w. This SOC has SGX 530 as its GPU. We are running Android 4.0.3 on this platform. We found the frame rate of Android apps seem to be low compared to same app running on similarly powered tablet.

我们有一个嵌入式系统,使用基于TI 8168的h/w。这个SOC有SGX 530作为GPU。我们在这个平台上运行Android 4.0.3。我们发现Android应用程序的帧率似乎比同样的应用程序在同样的平板电脑上运行要低。

After timing various functions in Android activity, android platform code, we noticed eglSwapBuffer() is taking 45+ ms most of the times. What I read in various forums is that it should not be more than 16ms. The resolution of the frame buffer is 1920x1080.

在对Android activity、Android平台代码中的各种功能进行定时后,我们注意到eglSwapBuffer()大部分时间都是45+ ms。我在各种论坛上看到的是不应该超过16ms。帧缓冲区的分辨率是1920x1080。

I appreciate any suggestions to fix this bottleneck.

我很欣赏任何解决这个瓶颈的建议。

The driver version (i.e /proc/pvr/version contents)

驱动程序版本(我。e /proc/pvr/version内容)

Version blaze_android_sgx_ogles1_ogles2_GPL sgxddk 18 1.8@789263 (release) omap4430_android
System Version String: SGX revision = 1.2.5

版本blaze_android_sgx_ogles1_ogles2_GPL sgxddk 18 1.8@789263(发布)omap4430_android系统版本字符串:SGX修订= 1.2.5

The contents of egl.cfg from /system/lib/egl folder:

egl的内容。cfg /系统/ lib / egl文件夹:

0 0 android
0 1 POWERVR_SGX530_125

0 android 0 1 POWERVR_SGX530_125

The contents of /system/lib/egl folder

/系统/lib/egl文件夹的内容。

egl.cfg
libEGL_POWERVR_SGX530_125.so
libGLES_android.so
libGLESv1_CM_POWERVR_SGX530_125.so
libGLESv2_POWERVR_SGX530_125.so

egl。cfg libEGL_POWERVR_SGX530_125。所以libGLES_android。所以libGLESv1_CM_POWERVR_SGX530_125。所以libGLESv2_POWERVR_SGX530_125.so

The contents of rc.pvr script from /system/bin/sgx folder

rc的内容。来自/system/bin/sgx文件夹的pvr脚本

#!/system/bin/sh

# PowerVR SGX DDK for Embedded Linux - installation script
#
# Copyright 2004-2006 by Imagination Technologies Limited.
# All rights reserved. No part of this software, either
# material or conceptual may be copied or distributed,
# transmitted, transcribed, stored in a retrieval system
# or translated into any human or computer language in any
# form by any means, electronic, mechanical, manual or
# other-wise, or disclosed to third parties without the
# express written permission of Imagination Technologies
# Limited, Unit 8, HomePark Industrial Estate,
# King's Langley, Hertfordshire, WD4 8LZ, U.K.

# Auto-generated for omap4430_android from
# $RCSfile: common.m4 $ $Revision: 1.8 $
# $RCSfile: rc.pvr.m4 $ $Revision: 1.26 $
# $RCSfile: rc.pvr.m4 $ $Revision: 1.5 $
#

load_pvr()
{
/system/bin/devmem2 0x48180F04 w 0x0
/system/bin/devmem2 0x48180900 w 0x2
/system/bin/devmem2 0x48180920 w 0x2

insmod /system/bin/sgx/pvrsrvkm.ko
insmod /system/bin/sgx/omaplfb.ko
sleep 1
chmod 0666 /dev/pvrsrvkm
/system/bin/pvrsrvinit
echo "Loaded PowerVR consumer services."
return 0;
}

unload_pvr()
{
if rmmod omaplfb; then :; else return 1; fi
if rmmod pvrsrvkm; then :; else return 1; fi
echo "Unloaded PowerVR consumer services."
return 0;
}

# Deal with the type of invocation we get.
#
case "$1" in
"start")
load_pvr
;;
stop)
if ! unload_pvr; then
echo "Couldn't unload modules" >&2;
fi
;;
reload|restart)
if unload_pvr; then
load_pvr
else
echo "Couldn't unload modules" >&2;
fi
;;
*)
echo "$0: unknown argument $1." >&2;
;;
esac

The surfaceflinger logs when it is coming up:

当它出现的时候,surfaceflinger记录:

SurfaceFlinger(687): starting up service SurfaceFlinger
SurfaceFlinger(687): SurfaceFlinger is starting
SurfaceFlinger(687): Initializing thread for: SurfaceFlinger
SurfaceFlinger(687): SurfaceFlinger's main thread ready to run. Initializing graphics H/W...
SurfaceFlinger(687): ro.sf.lcd_density not defined, using 160 dpi by default.
SurfaceFlinger(687): EGL informations:
SurfaceFlinger(687): # of configs : 30
SurfaceFlinger(687): vendor    : Android
SurfaceFlinger(687): version   : 1.4 Android META-EGL
SurfaceFlinger(687): extensions: EGL_KHR_image EGL_KHR_image_base EGL_KHR_image_base EGL_KHR_gl_texture_2D_image EGL_KHR_gl_texture_cubemap_image EGL_KHR_gl_renderbuffer_image EGL_KHR_fence_sync EGL_ANDROID_image_native_buffer EGL_ANDROID_image_native_buffer 
SurfaceFlinger(687): Client API: OpenGL ES
SurfaceFlinger(687): EGLSurface: 8-8-8-8, config=0x1
SurfaceFlinger(687): OpenGL informations:
SurfaceFlinger(687): vendor    : Imagination Technologies
SurfaceFlinger(687): renderer  : PowerVR SGX 530
SurfaceFlinger(687): version   : OpenGL ES-CM 1.1
SurfaceFlinger(687): extensions: GL_OES_byte_coordinates GL_OES_fixed_point GL_OES_single_precision GL_OES_matrix_get GL_OES_read_format GL_OES_compressed_paletted_texture GL_OES_point_sprite GL_OES_point_size_array GL_OES_matrix_palette GL_OES_draw_texture GL_OES_query_matrix GL_OES_texture_env_crossbar GL_OES_texture_mirrored_repeat GL_OES_texture_cube_map GL_OES_blend_subtract GL_OES_blend_func_separate GL_OES_blend_equation_separate GL_OES_stencil_wrap GL_OES_extended_matrix_palette GL_OES_framebuffer_object GL_OES_rgb8_rgba8 GL_OES_depth24 GL_OES_stencil8 GL_OES_compressed_ETC1_RGB8_texture GL_OES_mapbuffer GL_OES_EGL_image GL_OES_EGL_image_external GL_EXT_multi_draw_arrays GL_OES_required_internalformat GL_IMG_read_format GL_IMG_texture_compression_pvrtc GL_IMG_texture_format_BGRA8888 GL_EXT_texture_format_BGRA8888 GL_OES_egl_sync GL_IMG_vertex_array_object
SurfaceFlinger(687): GL_MAX_TEXTURE_SIZE = 2048
SurfaceFlinger(687): GL_MAX_VIEWPORT_DIMS = 2048 x 2048
SurfaceFlinger(687): flags = 00010000
SurfaceFlinger(687): This platform does not support HW composer

1 个解决方案

#1


1  

Ensure that the SGX is clocked at 333 MHz (refer to http://processors.wiki.ti.com/index.php/AM35x-OMAP35x_Graphics_SDK_Getting_Started_Guide). Beyond that, there is little you can do to push the limits of sgx530 on this platform. 16 mSec translates to 60 fps, and the SGX530 can drive 1080P resolution at this rate, only for blits, without any additional processing. This is not the case in Android, where SGX is used practically for everything.

确保SGX被锁定在333 MHz(参见http://processors.wiki.ti.com/index.php/AM35x-OMAP35x_Graphics_SDK_Getting_Started_Guide)。除此之外,要在这个平台上突破sgx530的极限,您几乎无能为力。16msec转换为60fps,并且SGX530可以以这种速度驱动1080P的分辨率,仅用于闪点,不需要任何额外的处理。这不是Android的情况,在这里,SGX几乎适用于所有事情。

Note that in this platform, the entire draw actually happens in swapbuffers due to the architecture.

注意,在这个平台中,由于体系结构的原因,整个绘制实际上发生在swapbuffer中。

#1


1  

Ensure that the SGX is clocked at 333 MHz (refer to http://processors.wiki.ti.com/index.php/AM35x-OMAP35x_Graphics_SDK_Getting_Started_Guide). Beyond that, there is little you can do to push the limits of sgx530 on this platform. 16 mSec translates to 60 fps, and the SGX530 can drive 1080P resolution at this rate, only for blits, without any additional processing. This is not the case in Android, where SGX is used practically for everything.

确保SGX被锁定在333 MHz(参见http://processors.wiki.ti.com/index.php/AM35x-OMAP35x_Graphics_SDK_Getting_Started_Guide)。除此之外,要在这个平台上突破sgx530的极限,您几乎无能为力。16msec转换为60fps,并且SGX530可以以这种速度驱动1080P的分辨率,仅用于闪点,不需要任何额外的处理。这不是Android的情况,在这里,SGX几乎适用于所有事情。

Note that in this platform, the entire draw actually happens in swapbuffers due to the architecture.

注意,在这个平台中,由于体系结构的原因,整个绘制实际上发生在swapbuffer中。