基于4412
上一节,删掉库后启动,报错出错 : invalid buffer handle given
在删除/system/lib/egl下的所有文件,因为现在已经用不上了
现在需要将libGLES_android拷贝进去,这个文件在frameworks/native/opengl/libagl
b. 添加属性让android系统认为自己运行于"没有GPU的模拟器"
修改libagl/Android.mk,给系统添加libGLES_android.so (软件实现的GL)
b.1 添加软件GPU库
开发板: su, mount -o remount /system
在服务器编译软件GPU库: mmm frameworks/native/opengl/libagl
把得到的libGLES_android.so复制到单板/system/lib/eg/,并添加读属性
b.2 修改frameworks/native/opengl/libagl/Android.mk (参考补丁)
b.3 修改属性文件 , 单板 /system/build.prop,添加:
ro.kernel.qemu=1
ro.kernel.qemu.gles=0
或修改源码 device/friendly-arm/tiny4412/system.prop 同样添加上述属性, 然后重新编译系统
重新启动后出错: no suitable EGLConfig found, giving up
c. 修改系统自带的gralloc模块的BUG
c.1 修改 hardware\libhardware\modules\gralloc\Framebuffer.cpp
HAL_PIXEL_FORMAT_BGRA_8888
改为:
HAL_PIXEL_FORMAT_RGBA_8888
mmm hardware/libhardware/modules/gralloc/
把gralloc.default.so复制到单板/system/lib/hw
重启,出错:BufferQueueProducer( 2320): [FramebufferSurface] dequeueBuffer: createGraphicBuffer failed
W/GraphicBufferAllocator( 1918): alloc(800, 480, 1, 00001a33, ...) failed -12 (Out of memory)
c.2 继续修改 hardware\libhardware\modules\gralloc\Framebuffer.cpp
mmm hardware/libhardware/modules/gralloc/
把gralloc.default.so复制到单板/system/lib/hw
成功!