Trying to get SGX libs to initialise

I have the drivers and latest libs installed, but still can't get this stuff to run. eglInitialize is failing, and as the lib is closed source I can't find out why. I'm running the latest OE build for Beagleboard (console, no X, tho I installed libx11-6 as it was a dependency).

# cat /proc/version
Linux version 2.6.28-omap1 (rvoisey@shuttle) (gcc version 4.2.1) #1 Mon Feb 2 17:56:09 GMT 2009

# cat /proc/cmdline
console=ttyS2,115200n8 root=/dev/mmcblk0p2 rootdelay=2 rootfstype=ext3 video=omapfb:vram:4M omapfb.video_mode=800x600MR-24@60

# ipkg info libgles-omap3
Package: libgles-omap3
Version: 3.00.00.06-r5.1
Depends: update-rc.d, libc6 (>= 2.6.1), libx11-6 (>= 1.1.5)
Recommends: libgles-omap3-tests, omap3-sgx-modules
Status: install user installed
Section: base
Architecture: armv7a
Maintainer: Rob Voisey <rob@pixelbeat.co.uk>
Size: 1265408
Description: libGLES for the omap3
Installed-Time: 1233976889
Installed-Size: 5664215

# cat /proc/pvr/version
Version 1.3.13.1397 (release) /.../tmp/work/beagleboard-pixelbeat-linux-gnueabi/omap3-sgx-modules-1.3.13.1397-r5/omap3-sgx-modules-7
System Version String: SGX revision = 1.0.3

# cat /proc/fb
0 omapfb
1 omapfb
2 omapfb

# cat /proc/pvr/nodes
Registered nodes
Addr Type Class Index Ref pvDev Size Res
c6ffc560 ?8 display 1 1 c7b94e60 48 00000000
c6ffc320 ?7 3D 0 1 c8943000 0 c7ad0bc0

The pre-built demos all fail like this:

# Raw/TrainingCourse/Initialization/OGLES2Initialization
Error: eglInitialize() failed.

I made a very simple test app, and observed that:

eglGetDisplay((EGLNativeDisplayType)EGL_DEFAULT_DISPLAY) returns 1

eglInitialize(eglDisplay, &iMajorVersion, &iMinorVersion) returns EGL_FALSE

Note that I can open /dev/fb0 and run my own graphics routines on it with no problem. I tried *not* doing so but that didn't help. I'm suspicious of the boot arguments and tried a few variants, but admit I'm groping around in the dark.

Thanks for any hints.

Rob

Op 7 feb 2009 om 20:40 heeft "Rob Voisey" <rob@pixelbeat.co.uk> het
volgende geschreven:\

I have the drivers and latest libs installed, but still can't get
this stuff
to run. eglInitialize is failing, and as the lib is closed source I
can't
find out why. I'm running the latest OE build for Beagleboard
(console, no
X, tho I installed libx11-6 as it was a dependency).

# cat /proc/version
Linux version 2.6.28-omap1 (rvoisey@shuttle) (gcc version 4.2.1) #1
Mon Feb
2 17:56:09 GMT 2009

# cat /proc/cmdline
console=ttyS2,115200n8 root=/dev/mmcblk0p2 rootdelay=2 rootfstype=ext3
video=omapfb:vram:4M omapfb.video_mode=800x600MR-24@60

Change that to mr-16, sgx doesn't support 32bit.

Regards,

Koen

Koen

Change that to mr-16, sgx doesn't support 32bit.

Thanks, that did get me further. The call to eglInitialize no longer fails, and a call to eglChooseConfig also succeeds, however eglCreateWindowSurface then fails with EGL_NOT_INITIALIZED. I'm using the config attributes from the lib examples:

EGL_SURFACE_TYPE = EGL_WINDOW_BIT
EGL_RENDERABLE_TYPE = EGL_OPENGL_ES2_BIT
EGL_CONTEXT_CLIENT_VERSION = 2

I remember why I hate closed source libraries now!

Rob

Rob,
Where you got the SGX lib? Could you share with me?
Regards,
Yi

Where you got the SGX lib? Could you share with me?

You need to contact TI to get the libraries.

Rob

A bit more info:

The following tests execute without error:

sgx_init_test
sgx_blit_test
sgx_render_test

The following tests fail:

sgx_flip_test FAIL - PVRSRV_ERROR_TOOMANYBUFFERS
sgx_render_flip_test FAIL - PVRSRV_ERROR_TOOMANYBUFFERS(27)

All EGL/OGLES tests fail with code 3001, which I believe is
EGL_NOT_INITIALIZED, raised during eglCreateWindowSurface.

I've attached some output.

I'll have a dig into that kernel module error tomorrow, but if anyone has
any ideas I'd love to hear them.

Rob

eglinfo.txt (1.41 KB)

sgx_blit_test.txt (2.71 KB)

sgx_flip_test.txt (2.01 KB)

sgx_init_test.txt (2.34 KB)

sgx_render_flip_test.txt (1.94 KB)

sgx_render_test.txt (2.37 KB)

Could you give me the contact email address? Thanks a lot.
Regards,
Yi

A bit more info:

The following tests execute without error:

sgx_init_test
sgx_blit_test
sgx_render_test

The following tests fail:

sgx_flip_test FAIL - PVRSRV_ERROR_TOOMANYBUFFERS
sgx_render_flip_test FAIL - PVRSRV_ERROR_TOOMANYBUFFERS(27)

All EGL/OGLES tests fail with code 3001, which I believe is
EGL_NOT_INITIALIZED, raised during eglCreateWindowSurface.

I've attached some output.

I'll have a dig into that kernel module error tomorrow, but if anyone has
any ideas I'd love to hear them.

You could try increasing the VRAM a bit in DSS2, that might help.

regards,

Koen

I went via the UK distributor, but the TI website offers this address:
gamingonomap@list.ti.com

http://focus.ti.com/general/docs/wtbu/wtbugencontent.tsp?templateId=6123&navigationId=12700&contentId=27458

Rob

You could try increasing the VRAM a bit in DSS2, that might help.

Thanks, that didn't solve the problem. However TI suggested adding:

[default]
WindowSystem=libpvrPVR2D_FRONTWSEGL.so

to powervi.ini and this did work around the problem. At last I can get on with some graphics development which is great news.

Rob

Ah right, the default is FLIP, which has no kernel support anymore.

regards,

Koen

Rob,

[default]
WindowSystem=libpvrPVR2D_FRONTWSEGL.so

to powervi.ini and this did work around the problem.

That's great news. Does that mean that you can now run the 3D demos?

Please forgive my ignorance, but where is this .ini file to be found?
I have run a "find / -name p*.ini" on my Beagle and it came up with a
couple of ini files, neither of which is this one.

That's great news. Does that mean that you can now run the 3D demos?

Yes. Some of them are quite pretty.

Please forgive my ignorance, but where is this .ini file to be found?
I have run a "find / -name p*.ini" on my Beagle and it came up with a
couple of ini files, neither of which is this one.

The ini file doesn't exist with the current distribution. Create it yourself: /etc/powervr.ini

Don't forget you must also run with a 16-bit framebuffer (which is a showstopper for me unfortunately).

Regards

Rob

Thanks, Rob.

I tried this but it didn't work - running strace showed that it was
still loading the "flip" library. I tried a couple of things, like
putting it in the current directory, to no avail. Perhaps some sort of
formatting issue?

However, you still gave me the vital information I needed.

I ended up copying the "frontwsegl" library I wanted over the "flip"
library. Dreadful, awful, hacky solution but it got me far enough to
run the demos. Now all I have to do is find a way to compile my own
game :slight_smile: