Thanks again, I’ve solved the issue that GLES will load X11 backend on tizen-ivi, by recompiling the mesa only with wayland, or “export EGL_PLATFORM=wayland” without recompiling.
But the new problem comes, my application crash again, in the application, all the egl initialize steps finished, like “eglGetDisplay ok, eglInitialize ok, eglChooseConfig ok, eglCreateContext ok,” but aftet call the “eglCreateWindowSurface”, my application crashed, analyze the mesa’s egl codes, I find out that “dri2_wl_create_window_surface” will be called via eglCreateWindowSurface. The below is two key functions, parameter “window” and “native_window” is the same one. API declaration: eglCreateWindowSurface(EGLDisplay dpy, EGLConfig config, EGLNativeWindowType window, const EGLint *attrib_list) dri2_wl_create_window_surface(_EGLDriver *drv, _EGLDisplay *disp, _EGLConfig *conf, void *native_window, const EGLint *attrib_list) My application’s window is based on QT, I normally use QT’s API like “Mainwindow-> effectiveWinId() “ or “Mainwindow->winId()” to get the WINDOW for “window”. But in wayland, I pass the “winId” to the eglCreateWindowSurface again, it failed, because mesa’s wayland interface need the struct named “wl_egl_window” for “native_window”, not just an window HWND integer on X11. struct wl_egl_window { struct wl_surface *surface; int width; int height; int dx; int dy; int attached_width; int attached_height; void *private; void (*resize_callback)(struct wl_egl_window *, void *); }; In the deep codes, native_window will be operated , so if I passed the HWND integer to “eglCreateWindowSurface”, it will crash! Is there any way could transform the QT window to the struct “wl_egl_window”? Best regards, Jacky NI. From: Manuel Bachmann [mailto:manuel.bachm...@open.eurogiciel.org] Sent: Wednesday, June 18, 2014 1:54 AM To: Jacky (ZhiJun) Ni Cc: ivi@lists.tizen.org Subject: Re: eglInitialize failed on tizen_20140422.1_ivi-release-mbr-i586-sdb.raw.bz2 Hmm, that shouldn't happen ; yes, updating to a more recent snapshot should solve this. At worst, on your current install, you could try this : export EGL_DRIVER=dri2 export EGL_PLATFORM=wayland ./run_my_program Not sure about the 2nd variable and the cases where it is actually read ; but worth trying. Running the binary from weston-terminal, and not a regular VT, may also help. 2014-06-17 11:40 GMT+02:00 Jacky (ZhiJun) Ni <j...@telecomsys.com>: HI Manuel, Thanks for your reply, I’ve tried your method but the application crash, then I use the gdb to trace the stack, find that libEGL.so.1 call the “ dri2_initialize_x11()”, as you mentioned it seems that EGL trying to use X11 backend, may I try the latest snapshots? the following is the bt print info: Program received signal SIGSEGV, Segmentation fault. [Switching to LWP 681] 0xb6f205aa in XGetXCBConnection () from /lib/libX11-xcb.so.1 (gdb) bt #0 0xb6f205aa in XGetXCBConnection () from /lib/libX11-xcb.so.1 #1 0xb7e29e8a in dri2_initialize_x11 () from /lib/libEGL.so.1 #2 0xb7e27851 in dri2_initialize () from /lib/libEGL.so.1 #3 0xb7e21710 in _eglMatchAndInitialize () from /lib/libEGL.so.1 #4 0xb7e21ac9 in _eglMatchDriver () from /lib/libEGL.so.1 #5 0xb7e1cbf8 in eglInitialize () from /lib/libEGL.so.1 Best Regards, Jacky Ni From: Manuel Bachmann [mailto:manuel.bachm...@open.eurogiciel.org] Sent: Tuesday, June 17, 2014 4:44 PM To: Jacky (ZhiJun) Ni Cc: ivi@lists.tizen.org Subject: Re: eglInitialize failed on tizen_20140422.1_ivi-release-mbr-i586-sdb.raw.bz2 Hi Jacky, It looks like EGL is trying to use its X11 backend ; which was the default on older installs due to the way EGL/Mesa used to be built (FYI, it was changed in latest snapshots). You may work around the problem by explicitly calling the EGL Wayland backend : #include <wayland-egl.h> struct wl_display *display; display = wl_display_connect (NULL); m_display = eglGetDisplay ((EGLNativeDisplayType) display); Regards, Manuel 2014-06-17 10:07 GMT+02:00 Jacky (ZhiJun) Ni <j...@telecomsys.com>: Hi all, I came across the issue that executing of function “eglInitialize “ failed, if anyone who knows the solution, please help me, the followings are the print info and my codes: eglGetDisplay begin eglGetDisplay end eglInitialize begin libEGL warning: DRI2: xcb_connect failed libEGL warning: DRI2: xcb_connect failed libEGL warning: GLX: failed to load GLX eglInitialize falied My snippet codes: printf("eglGetDisplay begin\n"); if ((m_display = eglGetDisplay(EGL_DEFAULT_DISPLAY)) != EGL_NO_DISPLAY) { errorLine = __LINE__; printf("eglGetDisplay falied\n"); return; } printf("eglGetDisplay end\n"); printf("eglInitialize begin\n"); if (!eglInitialize(m_display, 0, 0)) { errorLine = __LINE__; printf("eglInitialize falied\n"); return; } printf("eglInitialize end\n"); Best Regards, Jacky Ni CONFIDENTIALITY NOTICE: The information contained in this message may be privileged and/or confidential. If you are not the intended recipient, or responsible for delivering this message to the intended recipient, any review, forwarding, dissemination, distribution or copying of this communication or any attachment(s) is strictly prohibited. If you have received this message in error, please notify the sender immediately, and delete it and all attachments from your computer and network. _______________________________________________ IVI mailing list IVI@lists.tizen.org https://lists.tizen.org/listinfo/ivi -- Regards, Manuel BACHMANN Tizen Project VANNES-FR CONFIDENTIALITY NOTICE: The information contained in this message may be privileged and/or confidential. If you are not the intended recipient, or responsible for delivering this message to the intended recipient, any review, forwarding, dissemination, distribution or copying of this communication or any attachment(s) is strictly prohibited. If you have received this message in error, please notify the sender immediately, and delete it and all attachments from your computer and network. -- Regards, Manuel BACHMANN Tizen Project VANNES-FR CONFIDENTIALITY NOTICE: The information contained in this message may be privileged and/or confidential. If you are not the intended recipient, or responsible for delivering this message to the intended recipient, any review, forwarding, dissemination, distribution or copying of this communication or any attachment(s) is strictly prohibited. If you have received this message in error, please notify the sender immediately, and delete it and all attachments from your computer and network.
_______________________________________________ IVI mailing list IVI@lists.tizen.org https://lists.tizen.org/listinfo/ivi