This really is the way forwards....AndyD wrote:I think because they are concentrating on Weston/Wayland.mung wrote:Why has the foundation not done anything about improving X support?
PeterO
This really is the way forwards....AndyD wrote:I think because they are concentrating on Weston/Wayland.mung wrote:Why has the foundation not done anything about improving X support?
mung wrote: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.mimi123 wrote: Can you publish or send me the code? (PM is fine)
Maybe do it tommorrow evening but I was hoping to have further hack at the weekend then possible I could get the xshm implemented?
Your code is wrong 3 thousand times.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
Well I am not sure what the point of the code you posted was in the first place?.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.
Yes, Freedesktop has defined a standard X11 EGL API.*mung wrote:Well I am not sure what the point of the code you posted was in the first place?.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.
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?
How does that help this thread of thought?mimi123 wrote: Yes, Freedesktop has defined a standard X11 EGL API.*
* Used by Gnome3 , Chromium , and another apps.
mimi123 wrote:My code was tested with the openGl es 2.0 book samples.
It does compile.
No I still don't get it, this stuff is very confusing to me.mimi123 wrote:Search OpenGL ES 2 0 programming guide on Google.
Then cd to linux11 and make.
Do a : svn checkout http://opengles-book-samples.googlecode.com/svn/trunk/ opengles-book-samples-read-onlymung wrote:No I still don't get it, this stuff is very confusing to me.mimi123 wrote:Search OpenGL ES 2 0 programming guide on Google.
Then cd to linux11 and make.
can you explain where linux11 is?
I still do not see any gles examples that run accelerated in a window in X on the rpi, am I doing something wrong?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
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)
}
My X11EgLRPI just manages that. Compile that sample with my lib and see the result (in non-DLSYM mode).mung wrote:I was under the impression that this code would never work???
EGLNativeWindowType is platform dependent and rpi platform != X11 platform?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) }
or am I wrong?
mimi123 wrote: My X11EgLRPI just manages that. Compile that sample with my lib and see the result (in non-DLSYM mode).
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
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?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.
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?.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.
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.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&...