[Mesa-dev] Unable to find a matching EGL config on Wayland

Carsten Haitzler (The Rasterman) raster at rasterman.com
Mon Feb 3 08:56:46 UTC 2020


On Fri, 31 Jan 2020 14:48:29 +0530 "Devashish Tiwari" <devashish at cdot.in> said:

Hi Devashish.

That fact you have "SGX" for demos hints to me that you have some hardware with
an Imagination based GPU and drivers provided by them. Their drivers provide
EGL and and the implementation of eglChooseConfig() under the hood. You should
contact whoever provided you with your drivers for help as Daniel suggested.

It very likely is a set of proprietary drivers that Wayland as a project and set
of developers who work on and with it have nothing to do with. We can't help
with something we didn't build nor even can see the insides of because it's a
proprietary binary blob. If you were using Mesa based drivers (I suspect you
are not given the above) which are open source and have a lot of common
development happen hand in hand with wayland, then we may be able to.

> Hi Daniel,
> 
> My application, as I described, requires a display protocol to run. And it is
> using wayland.
> 
> Because if I stop weston and run my application, it throws me following error:
> 
> Error- Unable to init SDL: No available video device
> 
> Also, I just checked $WAYLAND_DISPLAY environment variable and it is already
> set to 'wayland-0'.
> 
> The fact that eglinfo works perfectly after stopping weston makes me think
> that my application uses SDL_EGL_ChooseConfig() to set some EGL
> parameters/attributes and then calls _this->egl_data->eglChooseConfig() to
> see if it matches any available egl configurations but is not able to match
> with configurations returned by this function. And in my opinion, the reason
> behind this is _this->egl_data->eglChooseConfig() somehow calls eglinfo it
> doesn't return available egl configurations on the EVM and hence matching
> fails and egl surface is not created.
> 
> Please check and revert.
> 
> On Fri, 31 Jan 2020 08:27:50 +0000, Daniel Stone wrote
> 
> Hi Devashish, 
>  It sounds like your application, as well as eglinfo, are not even 
>  trying to use Wayland. Maybe they are autodetecting the platform 
>  incorrectly and trying to use GBM instead. This could perhaps be 
>  solved by setting the $WAYLAND_DISPLAY environment variable to the 
>  name of the socket Weston uses (usually 'wayland-0'). However you 
>  should probably contact The Qt Company for support in using Qt, and 
>  you should contact TI (or your BSP vendor) for support with the 
>  proprietary Imagination EGL/GLES driver.
> 
>  Cheers, 
>  Daniel
> 
>  On Fri, 31 Jan 2020 at 08:12, Devashish Tiwari <devashish at cdot.in> wrote: 
>  > 
>  > Hello, 
>  > 
>  > 
>  > I have built a simple application using QT & SDL that has a button which
>  > opens a preview on clicking, whenever camera (system/usb) is connected to
>  > the EVM. 
>  > 
>  > My app successfully receives correct parameters related to camera
>  > (resolution, frame rate, frame format) and I have verified it using debug
>  > prints. However, when I click on preview button, it crashes and throws
>  > error related to EGL. 
>  > 
>  > 
>  > On executing it with gdb, I found out that it is not able to get a valid
>  > EGL configuration. The eglChooseConfig function (in SDL_egl.c) doesn't
>  > find a matching EGL config and it fails to create a surface and open the
>  > preview. 
>  > 
>  > Also, I do not get any "EGL 1.4 Initialised" prints when my app executes.
>  > This print, on the contrary, is visible when I run OGLES2ChameleonMan
>  > in /usr/bin/SGX/demos/Wayland. 
>  > 
>  > 
>  > On digging further, I found that the "eglinfo" command displays the egl
>  > configurations on the terminal. 
>  > 
>  > However, when it returns EGL_BAD_ALLOC on my EVM, if I run it without
>  > stopping weston. It runs successfully only after stopping weston. I am
>  > assuming this is the reason why my application is not able to find a
>  > matching EGL config because it runs over weston. 
>  > 
>  > ----------------------------------------------------------------------------------- 
>  > 
>  > root at am57xx-evm:/mnt# eglinfo 
>  > 
>  > eglGetConfigs():
>  > ======================================================================
>  > ********************************** EGL config number: 0 EGL vendor string:
>  > Imagination Technologies EGL version string: 1.4 build 1.14 at 3699939 (MAIN)
>  > EGL extensions: EGL_IMG_client_api_ogl EGL_KHR_image EGL_KHR_image_base
>  > EGL_KHR_gl_texture_2D_image EGL_KHR_gl_texture_cubemap_image
>  > EGL_KHR_gl_renderbuffer_image EGL_KHR_vg_parent_image EGL_IMG_cl_image
>  > EGL_KHR_fence_sync EGL_IMG_context_priority EGL_IMG_hibernate_process
>  > EGL_IMG_image_plane_attribs EGL_KHR_surfaceless_context EGL_KHR_wait_sync
>  > EGL_KHR_create_context EGL_WL_bind_wayland_display
>  > EGL_EXT_image_dma_buf_import EGL client APIs are: OpenGL_ES EGL config
>  > Attributes: EGL_CONFIG_ID = 0x1 EGL_BUFFER_SIZE = 0x20 EGL_RED_SIZE = 0x8
>  > EGL_GREEN_SIZE = 0x8 EGL_BLUE_SIZE = 0x8 EGL_LUMINANCE_SIZE = 0x0
>  > EGL_ALPHA_SIZE = 0x8 EGL_ALPHA_MASK_SIZE = 0x0 EGL_BIND_TO_TEXTURE_RGB =
>  > 0x1 EGL_BIND_TO_TEXTURE_RGBA = 0x1 EGL_COLOR_BUFFER_TYPE = 0x308e EGL_CONF
>  IG_CAVEAT = 0x3038 EGL_CONFORMANT = 0x1 EGL_DEPTH_SIZE = 0x18 EGL_LEVEL =
> 0x0 EGL_MAX_PBUFFER_WIDTH = 0x1000 EGL_MAX_PBUFFER_HEIGHT = 0x1000
> EGL_MAX_PBUFFER_PIXELS = 0x1000000 EGL_MAX_SWAP_INTERVAL = 0xa
> EGL_MIN_SWAP_INTERVAL = 0x1 EGL_NATIVE_RENDERABLE = 0x0 EGL_NATIVE_VISUAL_ID
> = 0x0 EGL_NATIVE_VISUAL_TYPE = 0x0 EGL_RENDERABLE_TYPE = 0x1
> EGL_OPENGL_ES_BIT EGL_SAMPLE_BUFFERS = 0x0 EGL_SAMPLES = 0x0 EGL_STENCIL_SIZE
> = 0x8 EGL_SURFACE_TYPE = 0x5 EGL_PBUFFER_BIT EGL_WINDOW_BIT
> EGL_TRANSPARENT_TYPE = 0x3038 EGL_TRANSPARENT_RED_VALUE = 0x0
> EGL_TRANSPARENT_GREEN_VALUE = 0x0 EGL_TRANSPARENT_BLUE_VALUE = 0x0 Creating
> Window surface.. PVR:(Error): WSEGL_CreateWindowDrawable: Couldn't set CRTC:
> Permission denied [0, ] Unable to create surface egl error
> 'EGL_BAD_ALLOC' (0x3003) 
>  > ----------------------------------------------------------------------------------- 
>  > 
>  > 
>  > Does anyone has any idea about this strange behaviour? 
>  > 
>  > Also, Is there any way to run eglinfo command without stopping weston?
>  > Because I think my application is polling available egl configurations at
>  > the run time, but is not returning anything as it runs over weston. 
>  > 
>  > 
>  > The ldd of my application returns: 
>  > 
>  > ----------------------------------------------------------------------------------- 
>  > 
>  > root at am57xx-evm:/mnt# ldd cam_preview 
>  > linux-vdso.so.1 (0xbec50000) 
>  > libpjsua.so.2 => /usr/local/PJSIP_ONLY/libpjsua.so.2 (0xb6e6e000) 
>  > libpjsip-ua.so.2 => /usr/local/PJSIP_ONLY/libpjsip-ua.so.2 (0xb6e48000) 
>  > libpjsip-simple.so.2 => /usr/local/PJSIP_ONLY/libpjsip-simple.so.2
>  > (0xb6e28000) libpjsip.so.2 => /usr/local/PJSIP_ONLY/libpjsip.so.2
>  > (0xb6dda000) libpjmedia-codec.so.2
>  > => /usr/local/PJSIP_ONLY/libpjmedia-codec.so.2 (0xb6dba000)
>  > libpjmedia-videodev.so.2 => /usr/local/PJSIP_ONLY/libpjmedia-videodev.so.2
>  > (0xb6d9e000) libpjmedia-audiodev.so.2
>  > => /usr/local/PJSIP_ONLY/libpjmedia-audiodev.so.2 (0xb6d88000)
>  > libpjmedia.so.2 => /usr/local/PJSIP_ONLY/libpjmedia.so.2 (0xb6d12000)
>  > libpjnath.so.2 => /usr/local/PJSIP_ONLY/libpjnath.so.2 (0xb6cdf000)
>  > libpjlib-util.so.2 => /usr/local/PJSIP_ONLY/libpjlib-util.so.2
>  > (0xb6cab000) libsrtp.so.2 => /usr/local/PJSIP_ONLY/libsrtp.so.2
>  > (0xb6c87000) libresample.so.2 => /usr/local/PJSIP_ONLY/libresample.so.2
>  > (0xb6c6a000) libgsmcodec.so.2 => /usr/local/PJSIP_ONLY/libgsmcodec.so.2
>  > (0xb6c4c000) libspeex.so.2 => /usr/local/PJSIP_ONLY/libspeex.so.2
>  > (0xb6c13000) libilbccodec.so.2 => /usr/local/PJSIP_ONLY/libilbccodec.so.2
>  > (0xb6bf4000) libg7221codec.so.2 => /usr/local/PJSIP_ONLY/libg7221codec.so.
>  > 2 (0xb6bd4000) libyuv.so.2 => /usr/local/PJSIP_ONLY/libyuv.so.2
>  > (0xb6ba5000) libpj.so.2 => /usr/local/PJSIP_ONLY/libpj.so.2 (0xb6b77000)
>  > libopenh264.so.5 => /usr/local/PJSIP_ONLY/libopenh264.so.5 (0xb6a94000)
>  > libstdc++.so.6 => /lib/libstdc++.so.6 (0xb6978000) libuuid.so.1
>  > => /lib/libuuid.so.1 (0xb6964000) librt.so.1 => /lib/librt.so.1
>  > (0xb694e000) libasound.so.2 => /usr/lib/libasound.so.2 (0xb686a000)
>  > libSDL2-2.0.so.0 => /usr/local/SDL_ONLY/libSDL2-2.0.so.0 (0xb6783000)
>  > libv4l2.so.0 => /usr/lib/libv4l2.so.0 (0xb6767000) libQt5Widgets.so.5
>  > => /usr/lib/libQt5Widgets.so.5 (0xb625e000) libQt5Gui.so.5
>  > => /usr/lib/libQt5Gui.so.5 (0xb5d71000) libQt5Core.so.5
>  > => /usr/lib/libQt5Core.so.5 (0xb5887000) libpthread.so.0
>  > => /lib/libpthread.so.0 (0xb5863000) libGLESv2.so.2
>  > => /usr/lib/libGLESv2.so.2 (0xb57e8000) libQt5X11Extras.so.5
>  > => /usr/local/PJSIP_ONLY/libQt5X11Extras.so.5 (0xb6f30000) libX11.so.6
>  > => /usr/lib/libX11.so.6 (0xb56cb000) libxcb.so.1 => /usr/lib/libxcb.so.1
>  > (0xb569b000) libXau.so.6 => /usr/lib/libXau.so.6 (0xb5688000) 
>  > libXdmcp.so.6 => /usr/lib/libXdmcp.so.6 (0xb5673000) 
>  > libm.so.6 => /lib/libm.so.6 (0xb55f7000) 
>  > libgcc_s.so.1 => /lib/libgcc_s.so.1 (0xb55ce000) 
>  > libc.so.6 => /lib/libc.so.6 (0xb54e1000) 
>  > /lib/ld-linux-armhf.so.3 (0xb6f16000) 
>  > libdl.so.2 => /lib/libdl.so.2 (0xb54ce000) 
>  > libwayland-client.so.0 => /usr/lib/libwayland-client.so.0 (0xb54b4000) 
>  > libpvr_wlegl.so.1 => /usr/lib/libpvr_wlegl.so.1 (0xb54a3000) 
>  > libwayland-cursor.so.0 => /usr/lib/libwayland-cursor.so.0 (0xb548c000) 
>  > libxkbcommon.so.0 => /usr/lib/libxkbcommon.so.0 (0xb5444000) 
>  > libv4lconvert.so.0 => /usr/lib/libv4lconvert.so.0 (0xb53c0000) 
>  > libjpeg.so.62 => /usr/lib/libjpeg.so.62 (0xb537c000) 
>  > libsrv_um.so.1 => /usr/lib/libsrv_um.so.1 (0xb5338000) 
>  > libpng16.so.16 => /usr/lib/libpng16.so.16 (0xb52ff000) 
>  > libz.so.1 => /lib/libz.so.1 (0xb52db000) 
>  > libicui18n.so.59 => /usr/lib/libicui18n.so.59 (0xb50db000) 
>  > libicuuc.so.59 => /usr/lib/libicuuc.so.59 (0xb4f71000) 
>  > libicudata.so.59 => /usr/lib/libicudata.so.59 (0xb364c000) 
>  > libdrm.so.2 => /usr/lib/libdrm.so.2 (0xb362f000) 
>  > libgbm.so.2 => /usr/lib/libgbm.so.2 (0xb361c000) 
>  > libudev.so.1 => /lib/libudev.so.1 (0xb3600000) 
>  > libwayland-server.so.0 => /usr/lib/libwayland-server.so.0 (0xb35e3000) 
>  > libdrm_omap.so.1 => /usr/lib/libdrm_omap.so.1 (0xb35d0000) 
>  > libffi.so.6 => /usr/lib/libffi.so.6 (0xb35b9000) 
>  > libIMGegl.so.1 => /usr/lib/libIMGegl.so.1 (0xb3593000) 
>  > libpvr2d.so.1 => /usr/lib/libpvr2d.so.1 (0xb357f000) 
>  > libresolv.so.2 => /lib/libresolv.so.2 (0xb355e000) 
>  > libcap.so.2 => /lib/libcap.so.2 (0xb3549000) 
>  > libdbm.so.1 => /usr/lib/libdbm.so.1 (0xb3537000) 
>  > 
>  > --------------------------------------------------------------------------------------------- 
>  > 
>  > -- 
>  > 
>  > Thanks & Regards, 
>  > 
>  > Devashish Tiwari 
>  > 
>  > CDOT India 
>  > 
>  > _______________________________________________ 
>  > mesa-dev mailing list 
>  > mesa-dev at lists.freedesktop.org 
>  > https://lists.freedesktop.org/mailman/listinfo/mesa-dev
> 
> --
> 
> Thanks & Regards,
> 
> Devashish Tiwari 
> CDOT India
> 
>  


-- 
------------- Codito, ergo sum - "I code, therefore I am" --------------
Carsten Haitzler - raster at rasterman.com



More information about the mesa-dev mailing list