Hi
I am a beginner inOpenGL ES 2.0,and get a problem,
After decompress Mali_OpenGL_ES_2.0_SDK_for_Linux_On_ARM_v1.2.0.9310_Linux.tar.gz
and install Sourcery CodeBench Lite Edition for ARM (arm-2013.05-24-arm-none-linux-gnueabi.bin),
build the sample (Cube)
bash build-x86-linux.sh Cube succeed
cd build/x86/Cube
ls
assets Cube
./Cube
Error: eglGetError() = 12291 (0x00003003) at /home/pass2014/Software/Mali_OpenGL_ES_2.0_SDK_for_Linux_On_ARM_v1.2.0/samples/linux/Cube/Cube.cpp:177
code
int main(void)
{
/* Intialize the Platform object for platform specific functions. */
Platform* platform = Platform::getInstance();
/* Initialize windowing system. */
platform->createWindow(WINDOW_W, WINDOW_H);
/* Initialize EGL. */
EGLRuntime::initializeEGL(EGLRuntime::OPENGLES2);
EGL_CHECK(eglMakeCurrent(EGLRuntime::display, EGLRuntime::surface, EGLRuntime::surface, EGLRuntime::context)); //line 177
/* Initialize OpenGL ES graphics subsystem. */
setupGraphics(WINDOW_W, WINDOW_H);
/* Timer variable to calculate FPS. */
Timer fpsTimer;
fpsTimer.reset();
bool end = false;
/* The rendering loop to draw the scene. */
while(!end)
/* If something has happened to the window, end the sample. */
if(platform->checkWindow() != Platform::WINDOW_IDLE)
end = true;
}
/* Calculate FPS. */
float fFPS = fpsTimer.getFPS();
if(fpsTimer.isTimePassed(1.0f))
LOGI("FPS:\t%.1f\n", fFPS);
/* Render a single frame */
renderFrame();
/*
* Push the EGL surface color buffer to the native window.
* Causes the rendered graphics to be displayed on screen.
*/
eglSwapBuffers(EGLRuntime::display, EGLRuntime::surface);
/* Shut down OpenGL ES. */
/* Shut down Text. */
delete text;
/* Shut down EGL. */
EGLRuntime::terminateEGL();
/* Shut down windowing system. */
platform->destroyWindow();
/* Shut down the Platform object. */
delete platform;
return 0;
What should I do to fix the problem?
Thanks
Hi Chris,
The only thing that jumps out from the ldd output is that it doesn't link against libGLES, so I'd be surprised indeed if you got any rendering to work.... I guess at this point your Hello_Triangle app is just calling egl functions and not gles ones? Does /usr/lib/mali contain anything other than libEGL.so? What is the ldd output for glxgears?
Hth,
Chris
Chris,
Hi Chris,
1、 I also got the problem , when i run the demo of the "Mali OpenGL ES SDK for Linux on ARM v2.0.0"in a framebuffer device ( Allwiner A20 soc)
# ./Cube
Error: eglGetError(): 12291 (0x3003)
Error: Failed to initialize EGL at : \Mali OpenGL ES SDK for Linux on ARM v2.0.0\simple-framework\src\EGLRuntime.cpp:115
2、The code
success = eglInitialize(display, NULL, NULL);
if(success != EGL_TRUE)
EGLint error = eglGetError();
LOGE("eglGetError(): %i (0x%.4x)\n", (int)error, (int)error);
LOGE("Failed to initialize EGL at %s:%i\n", __FILE__, __LINE__);
exit(1);
3、ldd output
# ldd Cube
libGLESv2.so => /lib/libGLESv2.so (0xb6f6a000)
libEGL.so => /lib/libEGL.so (0xb6f4a000)
libMali.so => /lib/libMali.so (0xb6eae000)
libUMP.so => /lib/libUMP.so (0xb6ea0000)
libstdc++.so.6 => /usr/lib/libstdc++.so.6 (0xb6dc9000)
libm.so.6 => /lib/libm.so.6 (0xb6d24000)
libgcc_s.so.1 => /lib/libgcc_s.so.1 (0xb6d11000)
libc.so.6 => /lib/libc.so.6 (0xb6bca000)
libpthread.so.0 => /lib/libpthread.so.0 (0xb6baa000)
libdl.so.2 => /lib/libdl.so.2 (0xb6b9d000)
/lib/ld-linux.so.3 (0xb6fa0000)
Any advice?
Thanks ,
Hi jackfeng,
Is it possible you're trying to run a version compiled for x11 on fbdev? whats the return code from eglGetDisplay?
Thanks,
1、It seems that it runs the branch of "Linux on ARM"
#if defined(_WIN32)
/* Win32 */
display = eglGetDisplay(platform->deviceContext);
#elif defined(__arm__)
/* Linux on ARM */
display = eglGetDisplay(EGL_DEFAULT_DISPLAY);
printf("ARM eglGetDisplay(): %i (0x%.4x)\n", (int)display, (int)display);
#else
/* Desktop Linux */
platform->display = XOpenDisplay(NULL);
display = eglGetDisplay(platform->display);
#endif
2、 The return code from eglGetDisplay is "1"
# ./cube
ARM eglGetDisplay(): 1 (0x0001)
3、The code
void EGLRuntime::initializeEGL(OpenGLESVersion requestedAPIVersion)
EGLBoolean success = EGL_FALSE;
if(display == EGL_NO_DISPLAY)
LOGE("No EGL Display available at %s:%i\n", __FILE__, __LINE__);
The latest SDK release is version 2.4.4, I'd recommend updating to that just in case it's an SDK issue which has been fixed in recent versions. Or is there a reason you're using an old version?
Also, how did you come by the kernel/userspace drivers for your board, were they supplied by the vendor specifically for use with the board and kernel you are using, or have you grabbed them from elsewhere?
Hi Chris ,
I have updated the SDK to v2.4.4 , and got the same result when i ran the sample.
Could you please tell me the different usage between the mali kernel and userspace drivers in detail?
The mali and ump kernel driver include in the BSP supplied by the Allwiner.but i have no idea about the userspace drivers,seems it could be fetched from the link below:
http://linux-sunxi.org/Mali_binary_driver
Generally speaking, it is highly advised to use a matching driver version for both the User side and Kernel side Mali driver. This ensures maximum compatibility.
Ideally also you should obtain both components from the same source, the OEM or Silicon manufacturer, as they may have modified either/both parts to include further optimisations or features that the vanilla driver that we provide may not have.
It is also worth mentioning that the kernel side is GPL and you should be entitled access to this. We provide the vanilla code on our website: Open Source Mali Midgard GPU Kernel Drivers - Mali Developer Center and Open Source Mali Utgard GPU Linux Kernel Drivers - Mali Developer Center depending on your Mali architecture. You should also be allowed access to the integrated/modified version from your OEM/Silicon Manufacturer.
However the user side driver is proprietary so you will need to get a binary version from 'somewhere'. As I mentioned above, for best results, you should get this from the OEM. We do provide a vanilla version on our website but it is device dependent and we do not have any Allwinner versions up. (For reference, ARM Mali Midgard GPU User Space Drivers - Mali Developer Center and ARM Mali Utgard GPU series User Space Drivers )
I hope that helps explain the situation a little better.
Kind Regards,
Michael McGeagh
Hi mcgeagh,
It is appreciated for your detailed explanation. I am going to apply for the drivers from my distributor of the board .