User avatar
PeterO
Posts: 6095
Joined: Sun Jul 22, 2012 4:14 pm

Re: X11 EGL on the Raspberry Pi

Thu Jul 24, 2014 8:11 am

AndyD wrote:
mung wrote:Why has the foundation not done anything about improving X support?
I think because they are concentrating on Weston/Wayland.
This really is the way forwards....
PeterO
Discoverer of the PI2 XENON DEATH FLASH!
Interests: C,Python,PIC,Electronics,Ham Radio (G0DZB),1960s British Computers.
"The primary requirement (as we've always seen in your examples) is that the code is readable. " Dougie Lawson

mung
Posts: 506
Joined: Fri Nov 18, 2011 10:49 am

Re: X11 EGL on the Raspberry Pi

Fri Jul 25, 2014 4:32 pm

mung wrote:
mimi123 wrote: Can you publish or send me the code? (PM is fine)
I will post something on this thread, but I have to get to the pi and transfer things off the SD card and also tidy up the code.

Maybe do it tommorrow evening but I was hoping to have further hack at the weekend then possible I could get the xshm implemented?

Okay I doubt I will do any more work on this over the weekend, but I have put some code up on a web page.

A sound proof of concept http://soundproofingforum.co.uk/rpi/

mung
Posts: 506
Joined: Fri Nov 18, 2011 10:49 am

Re: X11 EGL on the Raspberry Pi

Fri Jul 25, 2014 5:19 pm

I just realised I got PM and was told this code is wrong, can anyone look at this code and test if there is something wrong with it?

I only did some very minor tests and obviously the exit handling is not correct, but it sort of looked reasonable and worked with pi3d and the gles examples in /opt/vc/src.

I know nothing about gles so really only just hacking on the X side of things.

The code works but is slow with XPutimage, it should be a lot faster with XShmPutimage but there seem to be synchronisation problems.

I am not going to be looking at it this weekend, but if anyone can give any analysis maybe I can get the XShm stuff working, r if anyone else wants to work on this or collaborate please give input and post back in this thread.

Also please note the information in the code comments about setting X to run in 32 bpp in /boot/config.txt and setting XSHM 0 in the #defines

mimi123
Posts: 583
Joined: Thu Aug 22, 2013 3:32 pm

Re: X11 EGL on the Raspberry Pi

Fri Jul 25, 2014 7:57 pm

mung wrote:I just realised I got PM and was told this code is wrong, can anyone look at this code and test if there is something wrong with it?

I only did some very minor tests and obviously the exit handling is not correct, but it sort of looked reasonable and worked with pi3d and the gles examples in /opt/vc/src.

I know nothing about gles so really only just hacking on the X side of things.

The code works but is slow with XPutimage, it should be a lot faster with XShmPutimage but there seem to be synchronisation problems.

I am not going to be looking at it this weekend, but if anyone can give any analysis maybe I can get the XShm stuff working, r if anyone else wants to work on this or collaborate please give input and post back in this thread.

Also please note the information in the code comments about setting X to run in 32 bpp in /boot/config.txt and setting XSHM 0 in the #defines
Your code is wrong 3 thousand times.
The native window should be casted to an X11 window then used in X11 mode. NOT to create the window yourself.

Did you see the eglCreateWindowSurface of X11EGLRPI , it doesn't have that problem.

See the code of an X11 EGL app, like http://wiki.maemo.org/SimpleGL_example, and you will realise your fault.

mung
Posts: 506
Joined: Fri Nov 18, 2011 10:49 am

Re: X11 EGL on the Raspberry Pi

Fri Jul 25, 2014 9:42 pm

mimi123 wrote: Your code is wrong 3 thousand times.
The native window should be casted to an X11 window then used in X11 mode. NOT to create the window yourself.

Did you see the eglCreateWindowSurface of X11EGLRPI , it doesn't have that problem.

See the code of an X11 EGL app, like http://wiki.maemo.org/SimpleGL_example, and you will realise your fault.
Well I am not sure what the point of the code you posted was in the first place?.

Has the X consortium/freedesktop defined a library api and programming standard for gles like they did for GLX?

I could not workout what your code did other than encapsulated the libEGL and wrote it to a pixmapbuffer when swapbuffers occured, to me it looked like a duck, maybe it did not quack like one or fly like one but to the untrained eye it was the only duck I could roll from it.

Can you explain in understandable pseudo code what you are attempting to create with this library or were you trying to implement Xegl server?

If you are making some point with reference to the further use of glshim library then I would be interested to know how that fits in with the code you released?

I am really a newbie with gles and there are many things about it I do not understand, if you can be more specific rather than just saying "3000 times wrong" then maybe some progress could be made.

I have no real idea but I do not see how compositing and window layer stacking can integrate with X between gles nativewindowsurfaces so the only way to handle gles in an X window is to blit it with xputimage, I am probably wrong if you know better. Why not provide some code that does what you say and handles the window stacking/layering/compositing problem then everyone could run it and test it.

As far as I could see you released a load of broken code that would not compile or run, the code I released does what I wanted it to do, it maybe slow, untidy and badly commented but I don't have time to do that. If you want something else then please explain yourself so that you can be understood.

It maybe a good learning experience, but I was hoping an expert in gles could have easily handled this sort of thing.

P.S. Why is wayland taking so long?

mimi123
Posts: 583
Joined: Thu Aug 22, 2013 3:32 pm

Re: X11 EGL on the Raspberry Pi

Fri Jul 25, 2014 11:40 pm

mung wrote:
mimi123 wrote: Your code is wrong 3 thousand times.
The native window should be casted to an X11 window then used in X11 mode. NOT to create the window yourself.

Did you see the eglCreateWindowSurface of X11EGLRPI , it doesn't have that problem.

See the code of an X11 EGL app, like http://wiki.maemo.org/SimpleGL_example, and you will realise your fault.
Well I am not sure what the point of the code you posted was in the first place?.

Has the X consortium/freedesktop defined a library api and programming standard for gles like they did for GLX?

I could not workout what your code did other than encapsulated the libEGL and wrote it to a pixmapbuffer when swapbuffers occured, to me it looked like a duck, maybe it did not quack like one or fly like one but to the untrained eye it was the only duck I could roll from it.

Can you explain in understandable pseudo code what you are attempting to create with this library or were you trying to implement Xegl server?

If you are making some point with reference to the further use of glshim library then I would be interested to know how that fits in with the code you released?

I am really a newbie with gles and there are many things about it I do not understand, if you can be more specific rather than just saying "3000 times wrong" then maybe some progress could be made.

I have no real idea but I do not see how compositing and window layer stacking can integrate with X between gles nativewindowsurfaces so the only way to handle gles in an X window is to blit it with xputimage, I am probably wrong if you know better. Why not provide some code that does what you say and handles the window stacking/layering/compositing problem then everyone could run it and test it.

As far as I could see you released a load of broken code that would not compile or run, the code I released does what I wanted it to do, it maybe slow, untidy and badly commented but I don't have time to do that. If you want something else then please explain yourself so that you can be understood.

It maybe a good learning experience, but I was hoping an expert in gles could have easily handled this sort of thing.

P.S. Why is wayland taking so long?
Yes, Freedesktop has defined a standard X11 EGL API.*

* Used by Gnome3 , Chromium , and another apps.

mung
Posts: 506
Joined: Fri Nov 18, 2011 10:49 am

Re: X11 EGL on the Raspberry Pi

Sat Jul 26, 2014 9:24 am

mimi123 wrote: Yes, Freedesktop has defined a standard X11 EGL API.*

* Used by Gnome3 , Chromium , and another apps.
How does that help this thread of thought?

Your point being?

mung
Posts: 506
Joined: Fri Nov 18, 2011 10:49 am

Re: X11 EGL on the Raspberry Pi

Sat Jul 26, 2014 3:11 pm

Very sorry about this, someone just told me it does not compile, and I now realise I pasted instructions on how to compile the original code that was posted on this thread.

If you want to compile then you have to change the string ' k_eglGetDisplayCopy' to 'eglx11' in all the compile commands listed in the comments at the start of the code (alternatively just rename the file you download from eglx11.c to k_eglGetDisplayCopy.c).

I will maybe edit the file at : http://soundproofingforum.co.uk/rpi/ so the compile instructions are correct, but maynot have time this weekend.

mimi123
Posts: 583
Joined: Thu Aug 22, 2013 3:32 pm

Re: X11 EGL on the Raspberry Pi

Sat Jul 26, 2014 11:42 pm

My code was tested with the openGl es 2.0 book samples.
It does compile.

mung
Posts: 506
Joined: Fri Nov 18, 2011 10:49 am

Re: X11 EGL on the Raspberry Pi

Sun Jul 27, 2014 1:52 am

mimi123 wrote:My code was tested with the openGl es 2.0 book samples.
It does compile.

What exactly does your code do when it compiles?

I could not get it to work when I tried to compile it, I can see you are somewhat verbose in your replies and I do not want us to flood this thread too much, but could you elaborate as to what occured when your "code was tested with the openGl es 2.0 book samples."

I have absolutely no idea about gles or egl and only hacking on this as getting gles apps to run in an X window is something I want as part of another project I am considering.

I appologise if I am drolling on, but as I have no idea I have a lot of questions, does anyone have any suggestions as to which parts of the broadcom documentation may be relevant?

I also realise this idea of getting gles running in a window should become obsolete when mesa/gallium support for the vc4 becomes available as X drawable and nativewindow types support should then become seamless. I have heard that mesa for vc4 should be released by broadcom within the next month or two, anyone know if that is true?

I think if something does not happen soon rpi will get left behind by the many other ARM platforms that seem to have better graphics support.

mimi123
Posts: 583
Joined: Thu Aug 22, 2013 3:32 pm

Re: X11 EGL on the Raspberry Pi

Sun Jul 27, 2014 9:55 am

Search OpenGL ES 2 0 programming guide on Google.
Then cd to linux11 and make.

mung
Posts: 506
Joined: Fri Nov 18, 2011 10:49 am

Re: X11 EGL on the Raspberry Pi

Sun Jul 27, 2014 10:12 pm

mimi123 wrote:Search OpenGL ES 2 0 programming guide on Google.
Then cd to linux11 and make.
No I still don't get it, this stuff is very confusing to me.

can you explain where linux11 is?

mimi123
Posts: 583
Joined: Thu Aug 22, 2013 3:32 pm

Re: X11 EGL on the Raspberry Pi

Sun Jul 27, 2014 10:16 pm

mung wrote:
mimi123 wrote:Search OpenGL ES 2 0 programming guide on Google.
Then cd to linux11 and make.
No I still don't get it, this stuff is very confusing to me.

can you explain where linux11 is?
Do a : svn checkout http://opengles-book-samples.googlecode.com/svn/trunk/ opengles-book-samples-read-only
cd opengl*
cd Linux_X11
make

mung
Posts: 506
Joined: Fri Nov 18, 2011 10:49 am

Re: X11 EGL on the Raspberry Pi

Mon Jul 28, 2014 12:30 am

mimi123 wrote: Do a : svn checkout http://opengles-book-samples.googlecode.com/svn/trunk/ opengles-book-samples-read-only
cd opengl*
cd Linux_X11
make
I still do not see any gles examples that run accelerated in a window in X on the rpi, am I doing something wrong?

Which code are you using?

mung
Posts: 506
Joined: Fri Nov 18, 2011 10:49 am

Re: X11 EGL on the Raspberry Pi

Mon Jul 28, 2014 12:50 am

I was under the impression that this code would never work???

Code: Select all

EGLBoolean CreateEGLContext ( EGLNativeWindowType hWnd, EGLDisplay* eglDisplay,
                              EGLContext* eglContext, EGLSurface* eglSurface,
                              EGLint attribList[])
{
hwnd=XCreateSimpleWindow(dpy, rootwin,
        0, 0, esContext->width, esContext->height, 0,
        BlackPixel(dpy, scr), BlackPixel(dpy, scr));
 
XStoreName(dpy, win, "opengles2.0");
    // Get Display
    display = eglGetDisplay(EGL_DEFAULT_DISPLAY);
    // Initialize EGL
    eglInitialize(display, &majorVersion, &minorVersion)
    // Get configs
    eglGetConfigs(display, NULL, 0, &numConfigs)
    // Choose config
    eglChooseConfig(display, attribList, &config, 1, &numConfigs)
    // Create a surface
    surface = eglCreateWindowSurface(display, config, (EGLNativeWindowType)hWnd, NULL);
    // Create a GL context
    context = eglCreateContext(display, config, EGL_NO_CONTEXT, contextAttribs );
    // Make the context current
    eglMakeCurrent(display, surface, surface, context)
}
EGLNativeWindowType is platform dependent and rpi platform != X11 platform?

or am I wrong?

mimi123
Posts: 583
Joined: Thu Aug 22, 2013 3:32 pm

Re: X11 EGL on the Raspberry Pi

Mon Jul 28, 2014 1:53 am

mung wrote:I was under the impression that this code would never work???

Code: Select all

EGLBoolean CreateEGLContext ( EGLNativeWindowType hWnd, EGLDisplay* eglDisplay,
                              EGLContext* eglContext, EGLSurface* eglSurface,
                              EGLint attribList[])
{
hwnd=XCreateSimpleWindow(dpy, rootwin,
        0, 0, esContext->width, esContext->height, 0,
        BlackPixel(dpy, scr), BlackPixel(dpy, scr));
 
XStoreName(dpy, win, "opengles2.0");
    // Get Display
    display = eglGetDisplay(EGL_DEFAULT_DISPLAY);
    // Initialize EGL
    eglInitialize(display, &majorVersion, &minorVersion)
    // Get configs
    eglGetConfigs(display, NULL, 0, &numConfigs)
    // Choose config
    eglChooseConfig(display, attribList, &config, 1, &numConfigs)
    // Create a surface
    surface = eglCreateWindowSurface(display, config, (EGLNativeWindowType)hWnd, NULL);
    // Create a GL context
    context = eglCreateContext(display, config, EGL_NO_CONTEXT, contextAttribs );
    // Make the context current
    eglMakeCurrent(display, surface, surface, context)
}
EGLNativeWindowType is platform dependent and rpi platform != X11 platform?

or am I wrong?
My X11EgLRPI just manages that. Compile that sample with my lib and see the result (in non-DLSYM mode).

mung
Posts: 506
Joined: Fri Nov 18, 2011 10:49 am

Re: X11 EGL on the Raspberry Pi

Mon Jul 28, 2014 11:32 am

mimi123 wrote: My X11EgLRPI just manages that. Compile that sample with my lib and see the result (in non-DLSYM mode).

When you say 'just manages that' what do you mean by 'that'?

Your code is a manager?

Is your code some type of display manager that manages the X11 DDX or is it higher level and sends X events on to the EGL windowsurface for management by gles?

I am not sure how to compile your code, can you explain how your code is compiled?

When I run your INSTALL.sh script I get the folllowing errors:

Code: Select all

x11eglrpi $ ./install.sh 
k_eglGetDisplayCopy.c: In function ‘eglGetDisplay’:
k_eglGetDisplayCopy.c:52:3: warning: return makes pointer from integer without a cast [enabled by default]
k_eglGetDisplayCopy.c:55:2: error: expected ‘;’ before ‘puts’
k_eglGetDisplayCopy.c:58:7: warning: assignment makes pointer from integer without a cast [enabled by default]
k_eglGetDisplayCopy.c:59:11: warning: assignment makes pointer from integer without a cast [enabled by default]
k_eglGetDisplayCopy.c: In function ‘eglCreateWindowSurface’:
k_eglGetDisplayCopy.c:64:3: warning: return makes pointer from integer without a cast [enabled by default]
k_eglGetDisplayCopy.c:69:2: warning: passing argument 2 of ‘XGetWindowAttributes’ makes integer from pointer without a cast [enabled by default]
/usr/include/X11/Xlib.h:2699:15: note: expected ‘Window’ but argument is of type ‘Window *’
k_eglGetDisplayCopy.c: In function ‘eglSwapBuffers’:
k_eglGetDisplayCopy.c:138:4: warning: passing argument 2 of ‘XCreateGC’ makes integer from pointer without a cast [enabled by default]
/usr/include/X11/Xlib.h:1592:11: note: expected ‘Drawable’ but argument is of type ‘Window *’
k_eglGetDisplayCopy.c:139:3: warning: passing argument 2 of ‘XGetImage’ makes integer from pointer without a cast [enabled by default]
/usr/include/X11/Xlib.h:1464:16: note: expected ‘Drawable’ but argument is of type ‘Window *’
k_eglGetDisplayCopy.c:142:3: warning: passing argument 6 of ‘XCreateImage’ from incompatible pointer type [enabled by default]
/usr/include/X11/Xlib.h:1449:16: note: expected ‘char *’ but argument is of type ‘unsigned int *’
k_eglGetDisplayCopy.c:143:3: warning: passing argument 2 of ‘XPutImage’ makes integer from pointer without a cast [enabled by default]
/usr/include/X11/Xlib.h:2911:12: note: expected ‘Drawable’ but argument is of type ‘Window *’
mv: cannot stat `k_eglGetDisplayCopy.o': No such file or directory
rm: cannot remove `egl_client.c.o': Permission denied
libegl-unpack/egl_client-modified.c.o: In function `egl_vg_render_callback':
egl_client.c:(.text+0x510): multiple definition of `egl_vg_render_callback'
libegl-unpack/egl_client.c.o:egl_client.c:(.text+0x510): first defined here
libegl-unpack/egl_client-modified.c.o: In function `egl_gl_flush_callback':
egl_client.c:(.text+0x5d4): multiple definition of `egl_gl_flush_callback'
libegl-unpack/egl_client.c.o:egl_client.c:(.text+0x5d4): first defined here
libegl-unpack/egl_client-modified.c.o: In function `egl_vg_flush_callback':
egl_client.c:(.text+0x694): multiple definition of `egl_vg_flush_callback'
libegl-unpack/egl_client.c.o:egl_client.c:(.text+0x694): first defined here
libegl-unpack/egl_client-modified.c.o: In function `egl_gl_render_callback':
egl_client.c:(.text+0x754): multiple definition of `egl_gl_render_callback'
libegl-unpack/egl_client.c.o:egl_client.c:(.text+0x754): first defined here
libegl-unpack/egl_client-modified.c.o: In function `eglGetError':
egl_client.c:(.text+0x818): multiple definition of `eglGetError'
libegl-unpack/egl_client.c.o:egl_client.c:(.text+0x818): first defined here
libegl-unpack/egl_client-modified.c.o: In function `eglGetConfigs':
egl_client.c:(.text+0x874): multiple definition of `eglGetConfigs'
libegl-unpack/egl_client.c.o:egl_client.c:(.text+0x874): first defined here
libegl-unpack/egl_client-modified.c.o: In function `eglChooseConfig':
egl_client.c:(.text+0x96c): multiple definition of `eglChooseConfig'
libegl-unpack/egl_client.c.o:egl_client.c:(.text+0x96c): first defined here
libegl-unpack/egl_client-modified.c.o: In function `eglSaneChooseConfigBRCM':
egl_client.c:(.text+0x98c): multiple definition of `eglSaneChooseConfigBRCM'
libegl-unpack/egl_client.c.o:egl_client.c:(.text+0x98c): first defined here
libegl-unpack/egl_client-modified.c.o: In function `eglGetConfigAttrib':
egl_client.c:(.text+0x9ac): multiple definition of `eglGetConfigAttrib'
libegl-unpack/egl_client.c.o:egl_client.c:(.text+0x9ac): first defined here
libegl-unpack/egl_client-modified.c.o: In function `eglSetNextResourceHandle':
egl_client.c:(.text+0xa84): multiple definition of `eglSetNextResourceHandle'
libegl-unpack/egl_client.c.o:egl_client.c:(.text+0xa84): first defined here
libegl-unpack/egl_client-modified.c.o: In function `eglInitialize':
egl_client.c:(.text+0xa98): multiple definition of `eglInitialize'
libegl-unpack/egl_client.c.o:egl_client.c:(.text+0xa98): first defined here
libegl-unpack/egl_client-modified.c.o: In function `eglTerminate':
egl_client.c:(.text+0xb90): multiple definition of `eglTerminate'
libegl-unpack/egl_client.c.o:egl_client.c:(.text+0xb90): first defined here
libegl-unpack/egl_client-modified.c.o: In function `eglQueryString':
egl_client.c:(.text+0xc68): multiple definition of `eglQueryString'
libegl-unpack/egl_client.c.o:egl_client.c:(.text+0xc68): first defined here
libegl-unpack/egl_client-modified.c.o: In function `eglCreatePbufferSurface':
egl_client.c:(.text+0x100c): multiple definition of `eglCreatePbufferSurface'
libegl-unpack/egl_client.c.o:egl_client.c:(.text+0x100c): first defined here
libegl-unpack/egl_client-modified.c.o: In function `eglCreatePixmapSurface':
egl_client.c:(.text+0x129c): multiple definition of `eglCreatePixmapSurface'
libegl-unpack/egl_client.c.o:egl_client.c:(.text+0x129c): first defined here
libegl-unpack/egl_client-modified.c.o: In function `eglDestroySurface':
egl_client.c:(.text+0x160c): multiple definition of `eglDestroySurface'
libegl-unpack/egl_client.c.o:egl_client.c:(.text+0x160c): first defined here
libegl-unpack/egl_client-modified.c.o: In function `eglQuerySurface':
egl_client.c:(.text+0x1760): multiple definition of `eglQuerySurface'
libegl-unpack/egl_client.c.o:egl_client.c:(.text+0x1760): first defined here
libegl-unpack/egl_client-modified.c.o: In function `eglBindAPI':
egl_client.c:(.text+0x18a0): multiple definition of `eglBindAPI'
libegl-unpack/egl_client.c.o:egl_client.c:(.text+0x18a0): first defined here
libegl-unpack/egl_client-modified.c.o: In function `eglQueryAPI':
egl_client.c:(.text+0x1904): multiple definition of `eglQueryAPI'
libegl-unpack/egl_client.c.o:egl_client.c:(.text+0x1904): first defined here
libegl-unpack/egl_client-modified.c.o: In function `eglWaitClient':
egl_client.c:(.text+0x1940): multiple definition of `eglWaitClient'
libegl-unpack/egl_client.c.o:egl_client.c:(.text+0x1940): first defined here
libegl-unpack/egl_client-modified.c.o: In function `eglReleaseThread':
egl_client.c:(.text+0x1a30): multiple definition of `eglReleaseThread'
libegl-unpack/egl_client.c.o:egl_client.c:(.text+0x1a30): first defined here
libegl-unpack/egl_client-modified.c.o: In function `eglCreatePbufferFromClientBuffer':
egl_client.c:(.text+0x1c2c): multiple definition of `eglCreatePbufferFromClientBuffer'
libegl-unpack/egl_client.c.o:egl_client.c:(.text+0x1c2c): first defined here
libegl-unpack/egl_client-modified.c.o: In function `eglSurfaceAttrib':
egl_client.c:(.text+0x1e48): multiple definition of `eglSurfaceAttrib'
libegl-unpack/egl_client.c.o:egl_client.c:(.text+0x1e48): first defined here
libegl-unpack/egl_client-modified.c.o: In function `eglBindTexImage':
egl_client.c:(.text+0x1f10): multiple definition of `eglBindTexImage'
libegl-unpack/egl_client.c.o:egl_client.c:(.text+0x1f10): first defined here
libegl-unpack/egl_client-modified.c.o: In function `eglReleaseTexImage':
egl_client.c:(.text+0x20b8): multiple definition of `eglReleaseTexImage'
libegl-unpack/egl_client.c.o:egl_client.c:(.text+0x20b8): first defined here
libegl-unpack/egl_client-modified.c.o: In function `eglSwapInterval':
egl_client.c:(.text+0x2220): multiple definition of `eglSwapInterval'
libegl-unpack/egl_client.c.o:egl_client.c:(.text+0x2220): first defined here
libegl-unpack/egl_client-modified.c.o: In function `eglCreateContext':
egl_client.c:(.text+0x232c): multiple definition of `eglCreateContext'
libegl-unpack/egl_client.c.o:egl_client.c:(.text+0x232c): first defined here
libegl-unpack/egl_client-modified.c.o: In function `eglDestroyContext':
egl_client.c:(.text+0x25a4): multiple definition of `eglDestroyContext'
libegl-unpack/egl_client.c.o:egl_client.c:(.text+0x25a4): first defined here
libegl-unpack/egl_client-modified.c.o: In function `eglGetCurrentContext':
egl_client.c:(.text+0x2c70): multiple definition of `eglGetCurrentContext'
libegl-unpack/egl_client.c.o:egl_client.c:(.text+0x2c70): first defined here
libegl-unpack/egl_client-modified.c.o: In function `eglGetCurrentSurface':
egl_client.c:(.text+0x2ce4): multiple definition of `eglGetCurrentSurface'
libegl-unpack/egl_client.c.o:egl_client.c:(.text+0x2ce4): first defined here
libegl-unpack/egl_client-modified.c.o: In function `eglGetCurrentDisplay':
egl_client.c:(.text+0x2d98): multiple definition of `eglGetCurrentDisplay'
libegl-unpack/egl_client.c.o:egl_client.c:(.text+0x2d98): first defined here
libegl-unpack/egl_client-modified.c.o: In function `eglQueryContext':
egl_client.c:(.text+0x2e0c): multiple definition of `eglQueryContext'
libegl-unpack/egl_client.c.o:egl_client.c:(.text+0x2e0c): first defined here
libegl-unpack/egl_client-modified.c.o: In function `eglWaitGL':
egl_client.c:(.text+0x2f00): multiple definition of `eglWaitGL'
libegl-unpack/egl_client.c.o:egl_client.c:(.text+0x2f00): first defined here
libegl-unpack/egl_client-modified.c.o: In function `eglWaitNative':
egl_client.c:(.text+0x2fb0): multiple definition of `eglWaitNative'
libegl-unpack/egl_client.c.o:egl_client.c:(.text+0x2fb0): first defined here
libegl-unpack/egl_client-modified.c.o: In function `eglCopyBuffers':
egl_client.c:(.text+0x338c): multiple definition of `eglCopyBuffers'
libegl-unpack/egl_client.c.o:egl_client.c:(.text+0x338c): first defined here
libegl-unpack/egl_client-modified.c.o: In function `eglProcStateValid':
egl_client.c:(.text+0x3590): multiple definition of `eglProcStateValid'
libegl-unpack/egl_client.c.o:egl_client.c:(.text+0x3590): first defined here
collect2: ld returned 1 exit status
Installation END
What am I doing wrong, when you tested your code which compiler did you use?
Do you have any output from your compiler and screen shots of it working so I can workout what I should get when I succeed?

I am not sure how the X server works on the rpi, I assumed its just a simple FB server without acceleration and draws onto a fullscreen EGL texture buffer, how does compositing and window stacking fit in with that?

mung
Posts: 506
Joined: Fri Nov 18, 2011 10:49 am

Re: X11 EGL on the Raspberry Pi

Mon Jul 28, 2014 11:34 am

I thought I should mention I updated the code on the soundproofing web site link I posted previously:
http://soundproofingforum.co.uk/rpi/

http://soundproofingforum.co.uk/rpi/

mung
Posts: 506
Joined: Fri Nov 18, 2011 10:49 am

Re: X11 EGL on the Raspberry Pi

Tue Jul 29, 2014 11:56 am

I had a very quick look at your code last night and in order to test it I cut.copied just the important parts to compile and run as an X11 test not as a library and it did not seem to work either.

Can you tell me which versions of the rpi EGL libraries you compiled against to get your code working?

Which distro did you use, any other things you may have done to get an EGLwindowsurface to cast into an X11 window?

I am having real problems with the code and could do with some help.

mung
Posts: 506
Joined: Fri Nov 18, 2011 10:49 am

Re: X11 EGL on the Raspberry Pi

Wed Jul 30, 2014 10:17 am

mimi123 wrote: Your code is wrong 3 thousand times.
The native window should be casted to an X11 window then used in X11 mode. NOT to create the window yourself.

Did you see the eglCreateWindowSurface of X11EGLRPI , it doesn't have that problem.

See the code of an X11 EGL app, like http://wiki.maemo.org/SimpleGL_example, and you will realise your fault.
I do not want to be rude, but I am begining to wonder if you know what you are talking about and have any idea about EGL/gles?

I do not believe you have provided anything that worked properly to make EGL work correctly in an X11 window and you should have stated what you had done, what your plans were, and what needed to be fixed/implemented.

I would be pleased if people try to avoid pretending that they know something if they do not, if you are not sure about something why not save everyone some time as say so?

I actually took the time to check the code you reference above ( SimpleGL_example ) and it does not compile and it does not create an X window linked to an eglwindowsurface.

None of that functionality has been implemented by the vc4 gpu drivers as far as I can see, mali seems to have it but not vc4 yet.

I think you fail to see the complexity of creating a zero copy version of egl/X11 and there are a number of possibilities and different problems that could be encountered.

My guess is it would be a weeks work for someone that knows vc4 gpu and X11 programming to create a library that handles configurerequests/resize/damage/windowstacking and that would not be an easy weeks work.

And I am not sure wayland is ever going to be hugely better?

Why was Xegl http://www.freedesktop.org/wiki/Xegl/ removed from the Xorg dist?

mimi123
Posts: 583
Joined: Thu Aug 22, 2013 3:32 pm

Re: X11 EGL on the Raspberry Pi

Thu Jul 31, 2014 8:10 pm

Wayland is better by design. What would be fixed was clear : Add zerocopy in place of three-copy and add resizing windows support.

mung
Posts: 506
Joined: Fri Nov 18, 2011 10:49 am

Re: X11 EGL on the Raspberry Pi

Sun Aug 03, 2014 9:55 pm

mimi123 wrote:Wayland is better by design. What would be fixed was clear : Add zerocopy in place of three-copy and add resizing windows support.
So you throw out everything for a new GUI with no apps and toolkits, sounds like a good idea, when can we have this working with wayland?.

I had a quick look at http://www.broadcom.com/docs/support/vi ... G100-R.pdf
looks like page 23 and 39 suggest zero copy shared pixmaps in native format could be supported, so X should
be a simple implementation if someone can compile code for the qpu to give access via t
he firmware.

mung
Posts: 506
Joined: Fri Nov 18, 2011 10:49 am

Re: X11 EGL on the Raspberry Pi

Thu Aug 07, 2014 6:01 pm

Don't know if further posts in this thread are pointless or not, I doubt I will be doing any work on the code posted in the forseeable future, but I have a few more thoughts and links that probably are not relevant but maybe.

I was thinking about mali400 as there was a message earlier in thread showing that, and thinking about dri and opengl, and weather the X11 server within wayland/weston will ever work or if wayland/weston will be released in a usable form ever.

Seems mali has much better support and maybe someone could use mali drivers as a starting point for vc4 drivers?
Also glshim would fit in with this as mesa libgl is needed for it to have reasonable acceleration.

X11 mali driver code and some discussion posts on mali X11 drivers below:
http://malideveloper.arm.com/develop-fo ... y-drivers/
http://archlinuxarm.org/forum/viewtopic.php?f=33&t=5979
http://archlinuxarm.org/forum/viewtopic.php?f=33&t=5480

I wonder if it would have been quicker/better for the foundation to create a vc4 X11 driver than messing about with wayland/weston?

mimi123
Posts: 583
Joined: Thu Aug 22, 2013 3:32 pm

Re: X11 EGL on the Raspberry Pi

Fri Aug 08, 2014 2:52 pm

There will be a full OpenGL 2.1 driver which is in beta now by Eric Anholt.

It is Linux KMS and Mesa , supports X11&Wayland&...

mung
Posts: 506
Joined: Fri Nov 18, 2011 10:49 am

Re: X11 EGL on the Raspberry Pi

Fri Aug 08, 2014 6:08 pm

mimi123 wrote:There will be a full OpenGL 2.1 driver which is in beta now by Eric Anholt.

It is Linux KMS and Mesa , supports X11&Wayland&...
I have heard a while ago the vc4 is hardware compatible with OGL2.1 I have never seen any libs that suggest this is available I always assumed mesa was only available as sw renderer not hardware accelerated.

Where is the beta at?

https://github.com/anholt/linux/blob/vc ... m2708_fb.c
https://github.com/anholt?tab=activity

and other github repos do not suggest anything is beta?

http://anholt.livejournal.com/ shows no update in the last couple of weeks.

Will be nice when it appears, but it seems strange that processing is being moved on to ARM, not sure what proportion of processing will move to ARM side and why or what extra it allows?

Reading that blog makes me realise why I cannot write code for anything below library level.

Return to “General discussion”