Igalia / meta-webkit

Yocto / OpenEmbedded layer for WebKit based engines and browsers
MIT License
125 stars 67 forks source link

Cog with drm frame buffer on Intel not working #428

Closed gustavqmatic closed 1 year ago

gustavqmatic commented 1 year ago

Describe the issue We build cog with framebuffer on Intel. We use master on meta-webkit and kirkstone on meta-intel etc.

The build compile and run but nothing is seen on the screen. I can see that drm is set in package config using "bitbake -e cog". Other egl applications such as kmscube and glmark works as they should.

I have tried to debug the issue by adding my own logging to both webkit and mesa. I can see that the drm init is done correctly, mode '1920x1080' @ 60Hz is selected. A display with gbm backend is then created and it seems to work. Then /usr/lib/dri/iris_dri.so is loaded and I select gles as renderer, it list lots of configs and selects “config #0 with format 'XR30'”. After that I can see that the eglDisplay is created again, but this time it does not seem to be correct, driver name is empty, gbm name is garbage and fd is -1. This gives error “EGL user error 0x3001 (EGL_NOT_INITIALIZED) in eglInitialize: DRI2: gbm device using incorrect/incompatible backend”.

Cog does not crash/stop when this happens, but nothing is seen on the screen. When I press Ctrl-C to stop it some additional output is written: ^ClibEGL debug: EGL user error 0x3008 (EGL_BAD_DISPLAY) in eglQueryContext function is no-op function is no-op Couldn't open libGL.so.1 or libOpenGL.so.0

Any ideas what can stop it from setting up the display correctly?

To Reproduce

Fikes to reproduce the behavior:

  1. local.conf PREFERRED_PROVIDER_virtual/wpebackend = "wpebackend-fdo"
  2. distro DISTRO_FEATURES:append = "opengl"
  3. Image IMAGE_INSTALL:append (more than needed?) wpewebkit cog \ intel-media-driver libva mesa libva-utils igt-gpu-tools \ libgbm libdrm \ kmscube \
  4. Starting cog export G_MESSAGES_DEBUG=all export LIBGL_DEBUG=verbose export EGL_PLATFORM=drm export EGL_LOG_LEVEL=debug cog --platform-params="renderer=gles" -P drm https://www.google.com

Expected behavior Cog UI and webpage on the screen.

Environment (please complete the following information):

Additional context Full log inc logs added by me (starting with “Gustav”).

(process:3412): Cog-Core-DEBUG: 21:35:09.618: ensure_extension_points: Extension points registered.
(process:3412): Cog-Core-DEBUG: 21:35:09.619: cog_modules_add_directory: Scanning '/usr/lib/cog/modules'
Cog-INFO: 21:35:09.621: com.igalia.Cog.Platform:
Cog-INFO: 21:35:09.621:   drm - 200/CogDrmPlatform
(cog:3412): Cog-DEBUG: 21:35:09.624: platform_setup: Platform name: drm
(cog:3412): Cog-DRM-DEBUG: 21:35:09.626: init_config: overriding device_scale value, using 1.00 from shell
(cog:3412): Cog-DRM-DEBUG: 21:35:09.626: init_drm: enumerated device 0x562ab4297d80, available_nodes 5
(cog:3412): Cog-DRM-DEBUG: 21:35:09.626: init_drm:   DRM_NODE_PRIMARY: /dev/dri/card0
(cog:3412): Cog-DRM-DEBUG: 21:35:09.626: init_drm:   DRM_NODE_RENDER: /dev/dri/renderD128
(cog:3412): Cog-DRM-DEBUG: 21:35:09.626: init_drm: using device 0x562ab4297d80, DRM_NODE_PRIMARY /dev/dri/card0
(cog:3412): Cog-DRM-DEBUG: 21:35:09.626: init_drm: 5 connectors available
(cog:3412): Cog-DRM-DEBUG: 21:35:09.626: init_drm:  connector id 239, type 10, not connected, 0 usable modes
(cog:3412): Cog-DRM-DEBUG: 21:35:09.626: init_drm:  connector id 250, type 11, not connected, 0 usable modes
(cog:3412): Cog-DRM-DEBUG: 21:35:09.662: init_drm:  connector id 256, type 11, connected, 36 usable modes
(cog:3412): Cog-DRM-DEBUG: 21:35:09.662: init_drm:    [0]: '1920x1080', 1920x1080@60, flags 5, type 72 (preferred) 
(cog:3412): Cog-DRM-DEBUG: 21:35:09.662: init_drm:    [1]: '1920x1080', 1920x1080@60, flags 1048581, type 64 
(cog:3412): Cog-DRM-DEBUG: 21:35:09.662: init_drm:    [2]: '1920x1080', 1920x1080@60, flags 1048581, type 64 
(cog:3412): Cog-DRM-DEBUG: 21:35:09.662: init_drm:    [3]: '1920x1080', 1920x1080@50, flags 1048581, type 64 
(cog:3412): Cog-DRM-DEBUG: 21:35:09.662: init_drm:    [4]: '1680x1050', 1680x1050@60, flags 9, type 64 
(cog:3412): Cog-DRM-DEBUG: 21:35:09.662: init_drm:    [5]: '1600x900', 1600x900@60, flags 5, type 64 
(cog:3412): Cog-DRM-DEBUG: 21:35:09.662: init_drm:    [6]: '1280x1024', 1280x1024@75, flags 5, type 64 
(cog:3412): Cog-DRM-DEBUG: 21:35:09.662: init_drm:    [7]: '1280x1024', 1280x1024@60, flags 5, type 64 
(cog:3412): Cog-DRM-DEBUG: 21:35:09.662: init_drm:    [8]: '1440x900', 1440x900@60, flags 9, type 64 
(cog:3412): Cog-DRM-DEBUG: 21:35:09.662: init_drm:    [9]: '1280x800', 1280x800@60, flags 9, type 64 
(cog:3412): Cog-DRM-DEBUG: 21:35:09.662: init_drm:    [10]: '1152x864', 1152x864@75, flags 5, type 64 
(cog:3412): Cog-DRM-DEBUG: 21:35:09.662: init_drm:    [11]: '1280x720', 1280x720@60, flags 5, type 64 
(cog:3412): Cog-DRM-DEBUG: 21:35:09.662: init_drm:    [12]: '1280x720', 1280x720@60, flags 1048581, type 64 
(cog:3412): Cog-DRM-DEBUG: 21:35:09.662: init_drm:    [13]: '1280x720', 1280x720@60, flags 1048581, type 64 
(cog:3412): Cog-DRM-DEBUG: 21:35:09.662: init_drm:    [14]: '1280x720', 1280x720@50, flags 5, type 64 
(cog:3412): Cog-DRM-DEBUG: 21:35:09.662: init_drm:    [15]: '1280x720', 1280x720@50, flags 1048581, type 64 
(cog:3412): Cog-DRM-DEBUG: 21:35:09.662: init_drm:    [16]: '1024x768', 1024x768@75, flags 5, type 64 
(cog:3412): Cog-DRM-DEBUG: 21:35:09.662: init_drm:    [17]: '1024x768', 1024x768@70, flags 10, type 64 
(cog:3412): Cog-DRM-DEBUG: 21:35:09.662: init_drm:    [18]: '1024x768', 1024x768@60, flags 10, type 64 
(cog:3412): Cog-DRM-DEBUG: 21:35:09.662: init_drm:    [19]: '832x624', 832x624@75, flags 10, type 64 
(cog:3412): Cog-DRM-DEBUG: 21:35:09.662: init_drm:    [20]: '800x600', 800x600@75, flags 5, type 64 
(cog:3412): Cog-DRM-DEBUG: 21:35:09.662: init_drm:    [21]: '800x600', 800x600@72, flags 5, type 64 
(cog:3412): Cog-DRM-DEBUG: 21:35:09.662: init_drm:    [22]: '800x600', 800x600@60, flags 5, type 64 
(cog:3412): Cog-DRM-DEBUG: 21:35:09.662: init_drm:    [23]: '800x600', 800x600@56, flags 5, type 64 
(cog:3412): Cog-DRM-DEBUG: 21:35:09.662: init_drm:    [24]: '720x576', 720x576@50, flags 10, type 64 
(cog:3412): Cog-DRM-DEBUG: 21:35:09.662: init_drm:    [25]: '720x576', 720x576@50, flags 1048586, type 64 
(cog:3412): Cog-DRM-DEBUG: 21:35:09.662: init_drm:    [26]: '720x480', 720x480@60, flags 524298, type 64 
(cog:3412): Cog-DRM-DEBUG: 21:35:09.662: init_drm:    [27]: '720x480', 720x480@60, flags 1048586, type 64 
(cog:3412): Cog-DRM-DEBUG: 21:35:09.662: init_drm:    [28]: '720x480', 720x480@60, flags 10, type 64 
(cog:3412): Cog-DRM-DEBUG: 21:35:09.662: init_drm:    [29]: '720x480', 720x480@60, flags 1048586, type 64 
(cog:3412): Cog-DRM-DEBUG: 21:35:09.662: init_drm:    [30]: '640x480', 640x480@75, flags 10, type 64 
(cog:3412): Cog-DRM-DEBUG: 21:35:09.662: init_drm:    [31]: '640x480', 640x480@73, flags 10, type 64 
(cog:3412): Cog-DRM-DEBUG: 21:35:09.662: init_drm:    [32]: '640x480', 640x480@67, flags 10, type 64 
(cog:3412): Cog-DRM-DEBUG: 21:35:09.662: init_drm:    [33]: '640x480', 640x480@60, flags 524298, type 64 
(cog:3412): Cog-DRM-DEBUG: 21:35:09.662: init_drm:    [34]: '640x480', 640x480@60, flags 10, type 64 
(cog:3412): Cog-DRM-DEBUG: 21:35:09.662: init_drm:    [35]: '720x400', 720x400@70, flags 6, type 64 
(cog:3412): Cog-DRM-DEBUG: 21:35:09.662: init_drm:  connector id 260, type 10, not connected, 0 usable modes
(cog:3412): Cog-DRM-DEBUG: 21:35:09.662: init_drm:  connector id 267, type 11, not connected, 0 usable modes
(cog:3412): Cog-DRM-DEBUG: 21:35:09.697: init_drm: using connector id 256, type 11
(cog:3412): Cog-DRM-DEBUG: 21:35:09.698: init_drm: using mode [0] '1920x1080' @ 60Hz
Gustav gbm gbm_create_device fd=7
Gustav _gbm_create_device start
Gustav override_backend start
Gustav override_backend start
Gustav _gbm_create_device no dev from override, look from driver name
Gustav _gbm_create_device still no device, use find_backend instead
Gustav find_backend start, looking for (null)
Gustav Number of backends in list are 1
Gustav find_backend for dri == (null)
libGL: Can't open configuration file /etc/drirc: No such file or directory.
libGL: Can't open configuration file /home/root/.drirc: No such file or directory.
libGL: Can't open configuration file /etc/drirc: No such file or directory.
libGL: Can't open configuration file /home/root/.drirc: No such file or directory.
libGL: Can't open configuration file /etc/drirc: No such file or directory.
libGL: Can't open configuration file /home/root/.drirc: No such file or directory.
libGL: Can't open configuration file /etc/drirc: No such file or directory.
libGL: Can't open configuration file /home/root/.drirc: No such file or directory.
Gustav backend_create_device start
libEGL debug: Gustav _eglGetGbmDisplay native_display=0x562ab4298760
libEGL debug: Gustav _eglFindDisplay plat=3
libEGL debug: Gustav _eglFindDisplay Creating a new display disp=0x562ab42cb760
libEGL debug: Gustav _eglFindDisplay Creating a new display Platform=3
libEGL debug: Gustav _eglFindDisplay Creating a new display PlatformDisplay=0x562ab4298760
libEGL debug: Gustav _eglFindDisplay Creating a new display num_attribs=0
libEGL debug: Gustav eglapi.c eglInitialize *disp=0x562ab42cb760
libEGL debug: Gustav eglapi.c calling Initialize with *disp=0x562ab42cb760
libEGL info: Gustav egl_dri2 dri2_initialize disp=0x562ab42cb760
libEGL info: Gustav egl_dri2 dri2_initialize disp->Platform=3
libEGL info: Gustav egl_dri2 dri2_initialize disp->Platform=DRM
libEGL debug: Gustav platform_drm.c dri2_initialize_drm *disp=0x562ab42cb760
libEGL debug: Gustav gbm is set
libEGL debug: Gustav platform_drm dri2_initialize_drm *gbm=0x562ab4298760
libEGL debug: Gustav Backend name is drm
libEGL debug: Gustav Driver name is iris
libEGL debug: Gustav fd node type is 0
libEGL debug: Gustav driver IS NOT software driver
libEGL debug: MESA-LOADER: dlopen(/usr/lib/dri/iris_dri.so)

libEGL debug: found extension `DRI_Core'
libEGL info: found extension DRI_Core version 2
libEGL debug: found extension `DRI_IMAGE_DRIVER'
libEGL debug: found extension `DRI_DRI2'
libEGL info: found extension DRI_DRI2 version 4
libEGL debug: found extension `DRI_ConfigOptions'
libEGL debug: found extension `DRI_Core'
libEGL debug: found extension `DRI_IMAGE_DRIVER'
libEGL debug: found extension `DRI_DRI2'
libEGL debug: found extension `DRI_ConfigOptions'
libEGL info: found extension DRI_ConfigOptions version 2
libEGL debug: found extension `DRI_TexBuffer'
libEGL info: found extension DRI_TexBuffer version 2
libEGL debug: found extension `DRI2_Flush'
libEGL info: found extension DRI2_Flush version 4
libEGL debug: found extension `DRI_RENDERER_QUERY'
libEGL debug: found extension `DRI_CONFIG_QUERY'
libEGL debug: found extension `DRI2_Throttle'
libEGL debug: found extension `DRI2_Fence'
libEGL debug: found extension `DRI2_Interop'
libEGL debug: found extension `DRI_NoError'
libEGL debug: found extension `DRI2_Blob'
libEGL debug: found extension `DRI_MutableRenderBufferDriver'
libEGL debug: found extension `DRI_IMAGE'
libEGL info: found extension DRI_IMAGE version 20
libEGL debug: found extension `DRI2_BufferDamage'
libEGL debug: found extension `DRI_Robustness'
libEGL debug: found extension `DRI_TexBuffer'
libEGL debug: found extension `DRI2_Flush'
libEGL debug: found extension `DRI_RENDERER_QUERY'
libEGL info: found extension DRI_RENDERER_QUERY version 1
libEGL debug: found extension `DRI_CONFIG_QUERY'
libEGL info: found extension DRI_CONFIG_QUERY version 2
libEGL debug: found extension `DRI2_Throttle'
libEGL debug: found extension `DRI2_Fence'
libEGL info: found extension DRI2_Fence version 2
libEGL debug: found extension `DRI2_Interop'
libEGL info: found extension DRI2_Interop version 1
libEGL debug: found extension `DRI_NoError'
libEGL info: found extension DRI_NoError version 1
libEGL debug: found extension `DRI2_Blob'
libEGL info: found extension DRI2_Blob version 1
libEGL debug: found extension `DRI_MutableRenderBufferDriver'
libEGL info: found extension DRI_MutableRenderBufferDriver version 1
libEGL debug: found extension `DRI_IMAGE'
libEGL info: found extension DRI_IMAGE version 20
libEGL debug: found extension `DRI2_BufferDamage'
libEGL info: found extension DRI2_BufferDamage version 1
libEGL debug: found extension `DRI_Robustness'
libEGL info: found extension DRI_Robustness version 1
libEGL debug: did not find optional extension DRI_FlushControl version 1
libEGL debug: No DRI config supports native format R8  
libEGL debug: No DRI config supports native format R16 
libEGL debug: No DRI config supports native format GR88
libEGL debug: No DRI config supports native format GR32
libEGL debug: No DRI config supports native format AR15
libEGL debug: No DRI config supports native format XB24
libEGL debug: No DRI config supports native format AB24
libEGL debug: No DRI config supports native format XB30
libEGL debug: No DRI config supports native format AB30
(cog:3412): Cog-DRM-DEBUG: 21:35:09.704: cog_drm_gles_renderer_new: Using plane #31, crtc #98, connector #256 (atomic).
libEGL debug: eglPrintConfigDebug: nothing to print
libEGL debug: ---------------
libEGL debug: Configurations:
libEGL debug: cho       bf lv colourbuffer dp st  ms           vis  cav  bi     renderable           supported
libEGL debug: sen    id sz  l  r  g  b  a  th cl ns b           id  eat  nd  gl es es2 es3 vg         surfaces
libEGL debug: ---------------
libEGL debug:  20 0x001 32  0 10 10 10  2   0  0  0 0 0x30335241--            y  y   y   y                win,
libEGL debug:  21 0x002 32  0 10 10 10  2  16  0  0 0 0x30335241--            y  y   y   y                win,
libEGL debug:  22 0x003 32  0 10 10 10  2  24  0  0 0 0x30335241--            y  y   y   y                win,
libEGL debug:  23 0x004 32  0 10 10 10  2  24  8  0 0 0x30335241--            y  y   y   y                win,
libEGL debug:  24 0x005 32  0 10 10 10  2   0  0  2 1 0x30335241--            y  y   y   y                win,
libEGL debug:  28 0x006 32  0 10 10 10  2   0  0  4 1 0x30335241--            y  y   y   y                win,
libEGL debug:  32 0x007 32  0 10 10 10  2   0  0  8 1 0x30335241--            y  y   y   y                win,
libEGL debug:  36 0x008 32  0 10 10 10  2   0  0 16 1 0x30335241--            y  y   y   y                win,
libEGL debug:  25 0x009 32  0 10 10 10  2  16  0  2 1 0x30335241--            y  y   y   y                win,
libEGL debug:  29 0x00a 32  0 10 10 10  2  16  0  4 1 0x30335241--            y  y   y   y                win,
libEGL debug:  33 0x00b 32  0 10 10 10  2  16  0  8 1 0x30335241--            y  y   y   y                win,
libEGL debug:  37 0x00c 32  0 10 10 10  2  16  0 16 1 0x30335241--            y  y   y   y                win,
libEGL debug:  26 0x00d 32  0 10 10 10  2  24  0  2 1 0x30335241--            y  y   y   y                win,
libEGL debug:  30 0x00e 32  0 10 10 10  2  24  0  4 1 0x30335241--            y  y   y   y                win,
libEGL debug:  34 0x00f 32  0 10 10 10  2  24  0  8 1 0x30335241--            y  y   y   y                win,
libEGL debug:  38 0x010 32  0 10 10 10  2  24  0 16 1 0x30335241--            y  y   y   y                win,
libEGL debug:  27 0x011 32  0 10 10 10  2  24  8  2 1 0x30335241--            y  y   y   y                win,
libEGL debug:  31 0x012 32  0 10 10 10  2  24  8  4 1 0x30335241--            y  y   y   y                win,
libEGL debug:  35 0x013 32  0 10 10 10  2  24  8  8 1 0x30335241--            y  y   y   y                win,
libEGL debug:  39 0x014 32  0 10 10 10  2  24  8 16 1 0x30335241--            y  y   y   y                win,
libEGL debug:   0 0x015 30  0 10 10 10  0   0  0  0 0 0x30335258--            y  y   y   y                win,
libEGL debug:   1 0x016 30  0 10 10 10  0  16  0  0 0 0x30335258--            y  y   y   y                win,
libEGL debug:   2 0x017 30  0 10 10 10  0  24  0  0 0 0x30335258--            y  y   y   y                win,
libEGL debug:   3 0x018 30  0 10 10 10  0  24  8  0 0 0x30335258--            y  y   y   y                win,
libEGL debug:   4 0x019 30  0 10 10 10  0   0  0  2 1 0x30335258--            y  y   y   y                win,
libEGL debug:   8 0x01a 30  0 10 10 10  0   0  0  4 1 0x30335258--            y  y   y   y                win,
libEGL debug:  12 0x01b 30  0 10 10 10  0   0  0  8 1 0x30335258--            y  y   y   y                win,
libEGL debug:  16 0x01c 30  0 10 10 10  0   0  0 16 1 0x30335258--            y  y   y   y                win,
libEGL debug:   5 0x01d 30  0 10 10 10  0  16  0  2 1 0x30335258--            y  y   y   y                win,
libEGL debug:   9 0x01e 30  0 10 10 10  0  16  0  4 1 0x30335258--            y  y   y   y                win,
libEGL debug:  13 0x01f 30  0 10 10 10  0  16  0  8 1 0x30335258--            y  y   y   y                win,
libEGL debug:  17 0x020 30  0 10 10 10  0  16  0 16 1 0x30335258--            y  y   y   y                win,
libEGL debug:   6 0x021 30  0 10 10 10  0  24  0  2 1 0x30335258--            y  y   y   y                win,
libEGL debug:  10 0x022 30  0 10 10 10  0  24  0  4 1 0x30335258--            y  y   y   y                win,
libEGL debug:  14 0x023 30  0 10 10 10  0  24  0  8 1 0x30335258--            y  y   y   y                win,
libEGL debug:  18 0x024 30  0 10 10 10  0  24  0 16 1 0x30335258--            y  y   y   y                win,
libEGL debug:   7 0x025 30  0 10 10 10  0  24  8  2 1 0x30335258--            y  y   y   y                win,
libEGL debug:  11 0x026 30  0 10 10 10  0  24  8  4 1 0x30335258--            y  y   y   y                win,
libEGL debug:  15 0x027 30  0 10 10 10  0  24  8  8 1 0x30335258--            y  y   y   y                win,
libEGL debug:  19 0x028 30  0 10 10 10  0  24  8 16 1 0x30335258--            y  y   y   y                win,
libEGL debug:  60 0x029 32  0  8  8  8  8   0  0  0 0 0x34325241--            y  y   y   y                win,
libEGL debug:  61 0x02a 32  0  8  8  8  8  16  0  0 0 0x34325241--            y  y   y   y                win,
libEGL debug:  62 0x02b 32  0  8  8  8  8  24  0  0 0 0x34325241--            y  y   y   y                win,
libEGL debug:  63 0x02c 32  0  8  8  8  8  24  8  0 0 0x34325241--            y  y   y   y                win,
libEGL debug:  64 0x02d 32  0  8  8  8  8   0  0  2 1 0x34325241--            y  y   y   y                win,
libEGL debug:  68 0x02e 32  0  8  8  8  8   0  0  4 1 0x34325241--            y  y   y   y                win,
libEGL debug:  72 0x02f 32  0  8  8  8  8   0  0  8 1 0x34325241--            y  y   y   y                win,
libEGL debug:  76 0x030 32  0  8  8  8  8   0  0 16 1 0x34325241--            y  y   y   y                win,
libEGL debug:  65 0x031 32  0  8  8  8  8  16  0  2 1 0x34325241--            y  y   y   y                win,
libEGL debug:  69 0x032 32  0  8  8  8  8  16  0  4 1 0x34325241--            y  y   y   y                win,
libEGL debug:  73 0x033 32  0  8  8  8  8  16  0  8 1 0x34325241--            y  y   y   y                win,
libEGL debug:  77 0x034 32  0  8  8  8  8  16  0 16 1 0x34325241--            y  y   y   y                win,
libEGL debug:  66 0x035 32  0  8  8  8  8  24  0  2 1 0x34325241--            y  y   y   y                win,
libEGL debug:  70 0x036 32  0  8  8  8  8  24  0  4 1 0x34325241--            y  y   y   y                win,
libEGL debug:  74 0x037 32  0  8  8  8  8  24  0  8 1 0x34325241--            y  y   y   y                win,
libEGL debug:  78 0x038 32  0  8  8  8  8  24  0 16 1 0x34325241--            y  y   y   y                win,
libEGL debug:  67 0x039 32  0  8  8  8  8  24  8  2 1 0x34325241--            y  y   y   y                win,
libEGL debug:  71 0x03a 32  0  8  8  8  8  24  8  4 1 0x34325241--            y  y   y   y                win,
libEGL debug:  75 0x03b 32  0  8  8  8  8  24  8  8 1 0x34325241--            y  y   y   y                win,
libEGL debug:  79 0x03c 32  0  8  8  8  8  24  8 16 1 0x34325241--            y  y   y   y                win,
libEGL debug:  40 0x03d 24  0  8  8  8  0   0  0  0 0 0x34325258--            y  y   y   y                win,
libEGL debug:  41 0x03e 24  0  8  8  8  0  16  0  0 0 0x34325258--            y  y   y   y                win,
libEGL debug:  42 0x03f 24  0  8  8  8  0  24  0  0 0 0x34325258--            y  y   y   y                win,
libEGL debug:  43 0x040 24  0  8  8  8  0  24  8  0 0 0x34325258--            y  y   y   y                win,
libEGL debug:  44 0x041 24  0  8  8  8  0   0  0  2 1 0x34325258--            y  y   y   y                win,
libEGL debug:  48 0x042 24  0  8  8  8  0   0  0  4 1 0x34325258--            y  y   y   y                win,
libEGL debug:  52 0x043 24  0  8  8  8  0   0  0  8 1 0x34325258--            y  y   y   y                win,
libEGL debug:  56 0x044 24  0  8  8  8  0   0  0 16 1 0x34325258--            y  y   y   y                win,
libEGL debug:  45 0x045 24  0  8  8  8  0  16  0  2 1 0x34325258--            y  y   y   y                win,
libEGL debug:  49 0x046 24  0  8  8  8  0  16  0  4 1 0x34325258--            y  y   y   y                win,
libEGL debug:  53 0x047 24  0  8  8  8  0  16  0  8 1 0x34325258--            y  y   y   y                win,
libEGL debug:  57 0x048 24  0  8  8  8  0  16  0 16 1 0x34325258--            y  y   y   y                win,
libEGL debug:  46 0x049 24  0  8  8  8  0  24  0  2 1 0x34325258--            y  y   y   y                win,
libEGL debug:  50 0x04a 24  0  8  8  8  0  24  0  4 1 0x34325258--            y  y   y   y                win,
libEGL debug:  54 0x04b 24  0  8  8  8  0  24  0  8 1 0x34325258--            y  y   y   y                win,
libEGL debug:  58 0x04c 24  0  8  8  8  0  24  0 16 1 0x34325258--            y  y   y   y                win,
libEGL debug:  47 0x04d 24  0  8  8  8  0  24  8  2 1 0x34325258--            y  y   y   y                win,
libEGL debug:  51 0x04e 24  0  8  8  8  0  24  8  4 1 0x34325258--            y  y   y   y                win,
libEGL debug:  55 0x04f 24  0  8  8  8  0  24  8  8 1 0x34325258--            y  y   y   y                win,
libEGL debug:  59 0x050 24  0  8  8  8  0  24  8 16 1 0x34325258--            y  y   y   y                win,
libEGL debug:  80 0x051 16  0  5  6  5  0   0  0  0 0 0x36314752--            y  y   y   y                win,
libEGL debug:  81 0x052 16  0  5  6  5  0  16  0  0 0 0x36314752--            y  y   y   y                win,
libEGL debug:  82 0x053 16  0  5  6  5  0  24  0  0 0 0x36314752--            y  y   y   y                win,
libEGL debug:  83 0x054 16  0  5  6  5  0  24  8  0 0 0x36314752--            y  y   y   y                win,
libEGL debug:  84 0x055 16  0  5  6  5  0   0  0  2 1 0x36314752--            y  y   y   y                win,
libEGL debug:  88 0x056 16  0  5  6  5  0   0  0  4 1 0x36314752--            y  y   y   y                win,
libEGL debug:  92 0x057 16  0  5  6  5  0   0  0  8 1 0x36314752--            y  y   y   y                win,
libEGL debug:  96 0x058 16  0  5  6  5  0   0  0 16 1 0x36314752--            y  y   y   y                win,
libEGL debug:  85 0x059 16  0  5  6  5  0  16  0  2 1 0x36314752--            y  y   y   y                win,
libEGL debug:  89 0x05a 16  0  5  6  5  0  16  0  4 1 0x36314752--            y  y   y   y                win,
libEGL debug:  93 0x05b 16  0  5  6  5  0  16  0  8 1 0x36314752--            y  y   y   y                win,
libEGL debug:  97 0x05c 16  0  5  6  5  0  16  0 16 1 0x36314752--            y  y   y   y                win,
libEGL debug:  86 0x05d 16  0  5  6  5  0  24  0  2 1 0x36314752--            y  y   y   y                win,
libEGL debug:  90 0x05e 16  0  5  6  5  0  24  0  4 1 0x36314752--            y  y   y   y                win,
libEGL debug:  94 0x05f 16  0  5  6  5  0  24  0  8 1 0x36314752--            y  y   y   y                win,
libEGL debug:  98 0x060 16  0  5  6  5  0  24  0 16 1 0x36314752--            y  y   y   y                win,
libEGL debug:  87 0x061 16  0  5  6  5  0  24  8  2 1 0x36314752--            y  y   y   y                win,
libEGL debug:  91 0x062 16  0  5  6  5  0  24  8  4 1 0x36314752--            y  y   y   y                win,
libEGL debug:  95 0x063 16  0  5  6  5  0  24  8  8 1 0x36314752--            y  y   y   y                win,
libEGL debug:  99 0x064 16  0  5  6  5  0  24  8 16 1 0x36314752--            y  y   y   y                win,
libEGL debug:     0x065 64  0 16 16 16 16   0  0  0 0 0x48344241--            y  y   y   y                win,
libEGL debug:     0x066 64  0 16 16 16 16  16  0  0 0 0x48344241--            y  y   y   y                win,
libEGL debug:     0x067 64  0 16 16 16 16  24  0  0 0 0x48344241--            y  y   y   y                win,
libEGL debug:     0x068 64  0 16 16 16 16  24  8  0 0 0x48344241--            y  y   y   y                win,
libEGL debug:     0x069 64  0 16 16 16 16   0  0  2 1 0x48344241--            y  y   y   y                win,
libEGL debug:     0x06a 64  0 16 16 16 16   0  0  4 1 0x48344241--            y  y   y   y                win,
libEGL debug:     0x06b 64  0 16 16 16 16   0  0  8 1 0x48344241--            y  y   y   y                win,
libEGL debug:     0x06c 64  0 16 16 16 16   0  0 16 1 0x48344241--            y  y   y   y                win,
libEGL debug:     0x06d 64  0 16 16 16 16  16  0  2 1 0x48344241--            y  y   y   y                win,
libEGL debug:     0x06e 64  0 16 16 16 16  16  0  4 1 0x48344241--            y  y   y   y                win,
libEGL debug:     0x06f 64  0 16 16 16 16  16  0  8 1 0x48344241--            y  y   y   y                win,
libEGL debug:     0x070 64  0 16 16 16 16  16  0 16 1 0x48344241--            y  y   y   y                win,
libEGL debug:     0x071 64  0 16 16 16 16  24  0  2 1 0x48344241--            y  y   y   y                win,
libEGL debug:     0x072 64  0 16 16 16 16  24  0  4 1 0x48344241--            y  y   y   y                win,
libEGL debug:     0x073 64  0 16 16 16 16  24  0  8 1 0x48344241--            y  y   y   y                win,
libEGL debug:     0x074 64  0 16 16 16 16  24  0 16 1 0x48344241--            y  y   y   y                win,
libEGL debug:     0x075 64  0 16 16 16 16  24  8  2 1 0x48344241--            y  y   y   y                win,
libEGL debug:     0x076 64  0 16 16 16 16  24  8  4 1 0x48344241--            y  y   y   y                win,
libEGL debug:     0x077 64  0 16 16 16 16  24  8  8 1 0x48344241--            y  y   y   y                win,
libEGL debug:     0x078 64  0 16 16 16 16  24  8 16 1 0x48344241--            y  y   y   y                win,
libEGL debug:     0x079 48  0 16 16 16  0   0  0  0 0 0x48344258--            y  y   y   y                win,
libEGL debug:     0x07a 48  0 16 16 16  0  16  0  0 0 0x48344258--            y  y   y   y                win,
libEGL debug:     0x07b 48  0 16 16 16  0  24  0  0 0 0x48344258--            y  y   y   y                win,
libEGL debug:     0x07c 48  0 16 16 16  0  24  8  0 0 0x48344258--            y  y   y   y                win,
libEGL debug:     0x07d 48  0 16 16 16  0   0  0  2 1 0x48344258--            y  y   y   y                win,
libEGL debug:     0x07e 48  0 16 16 16  0   0  0  4 1 0x48344258--            y  y   y   y                win,
libEGL debug:     0x07f 48  0 16 16 16  0   0  0  8 1 0x48344258--            y  y   y   y                win,
libEGL debug:     0x080 48  0 16 16 16  0   0  0 16 1 0x48344258--            y  y   y   y                win,
libEGL debug:     0x081 48  0 16 16 16  0  16  0  2 1 0x48344258--            y  y   y   y                win,
libEGL debug:     0x082 48  0 16 16 16  0  16  0  4 1 0x48344258--            y  y   y   y                win,
libEGL debug:     0x083 48  0 16 16 16  0  16  0  8 1 0x48344258--            y  y   y   y                win,
libEGL debug:     0x084 48  0 16 16 16  0  16  0 16 1 0x48344258--            y  y   y   y                win,
libEGL debug:     0x085 48  0 16 16 16  0  24  0  2 1 0x48344258--            y  y   y   y                win,
libEGL debug:     0x086 48  0 16 16 16  0  24  0  4 1 0x48344258--            y  y   y   y                win,
libEGL debug:     0x087 48  0 16 16 16  0  24  0  8 1 0x48344258--            y  y   y   y                win,
libEGL debug:     0x088 48  0 16 16 16  0  24  0 16 1 0x48344258--            y  y   y   y                win,
libEGL debug:     0x089 48  0 16 16 16  0  24  8  2 1 0x48344258--            y  y   y   y                win,
libEGL debug:     0x08a 48  0 16 16 16  0  24  8  4 1 0x48344258--            y  y   y   y                win,
libEGL debug:     0x08b 48  0 16 16 16  0  24  8  8 1 0x48344258--            y  y   y   y                win,
libEGL debug:     0x08c 48  0 16 16 16  0  24  8 16 1 0x48344258--            y  y   y   y                win,
(cog:3412): Cog-DRM-DEBUG: 21:35:09.801: cog_drm_gles_renderer_initialize: Using config #0 with format 'XR30'
Gustav gbm gbm_surface_create gbm=0x562ab4298760
(cog:3412): Cog-DRM-DEBUG: 21:35:09.817: cog_drm_platform_setup: Renderer 'gles' initialized.
(cog:3412): Cog-DEBUG: 21:35:09.817: platform_setup: Selected CogDrmPlatform @ 0x562ab4276e40

(cog:3412): GLib-GIO-WARNING **: 21:35:09.820: Your application does not implement g_application_activate() and has no handlers connected to the 'activate' signal.  It should do one of these.
(process:3421): GLib-GIO-DEBUG: 21:35:09.836: Failed to initialize portal (GNetworkMonitorPortal) for gio-network-monitor: Not using portals
(process:3421): GLib-GIO-DEBUG: 21:35:09.840: Failed to initialize networkmanager (GNetworkMonitorNM) for gio-network-monitor: NetworkManager not running
(process:3421): GLib-GIO-DEBUG: 21:35:09.841: _g_io_module_get_default: Found default implementation netlink (GNetworkMonitorNetlink) for ?gio-network-monitor?
(process:3421): GLib-GIO-DEBUG: 21:35:09.842: _g_io_module_get_default: Found default implementation local (GLocalVfs) for ?gio-vfs?
(process:3421): GLib-GIO-DEBUG: 21:35:09.844: _g_io_module_get_default: Found default implementation dummy (GDummyProxyResolver) for ?gio-proxy-resolver?
(process:3421): GLib-GIO-DEBUG: 21:35:09.844: GSocketClient: Starting new address enumeration
libEGL debug: Gustav eglGetDisplay nativeDisplay=0x55d8077c0730
libEGL debug: Native platform type: drm (environment)
libEGL debug: Gustav _eglFindDisplay plat=3
libEGL debug: Gustav _eglFindDisplay Creating a new display disp=0x55d8077c5b70
libEGL debug: Gustav _eglFindDisplay Creating a new display Platform=3
libEGL debug: Gustav _eglFindDisplay Creating a new display PlatformDisplay=0x55d8077c0730
libEGL debug: Gustav _eglFindDisplay Creating a new display num_attribs=0
libEGL debug: Gustav eglGetDisplay disp=0x55d8077c5b70
Gustav initializeEGLDisplay eglGetDisplay done, m_eglDisplay=0x55d8077c5b70
libEGL debug: Gustav eglapi.c eglInitialize *disp=0x55d8077c5b70
libEGL debug: Gustav eglapi.c calling Initialize with *disp=0x55d8077c5b70
libEGL info: Gustav egl_dri2 dri2_initialize disp=0x55d8077c5b70
libEGL info: Gustav egl_dri2 dri2_initialize disp->Platform=3
libEGL info: Gustav egl_dri2 dri2_initialize disp->Platform=DRM
libEGL debug: Gustav platform_drm.c dri2_initialize_drm *disp=0x55d8077c5b70
libEGL debug: Gustav gbm is set
libEGL debug: Gustav platform_drm dri2_initialize_drm *gbm=0x55d8077c0730
libEGL debug: Gustav Backend name is �J
                                       ��
libEGL debug: Gustav Driver name is 
libEGL debug: Gustav fd node type is -1
libEGL debug: Gustav driver IS NOT software driver
libEGL debug: EGL user error 0x3001 (EGL_NOT_INITIALIZED) in eglInitialize: DRI2: gbm device using incorrect/incompatible backend

libEGL info: Gustav egl_dri2 dri2_initialize disp=0x55d8077c5b70
libEGL info: Gustav egl_dri2 dri2_initialize disp->Platform=3
libEGL info: Gustav egl_dri2 dri2_initialize disp->Platform=DRM
libEGL debug: Gustav platform_drm.c dri2_initialize_drm *disp=0x55d8077c5b70
libEGL debug: Gustav gbm is set
libEGL debug: Gustav platform_drm dri2_initialize_drm *gbm=0x55d8077c0730
libEGL debug: Gustav Backend name is �J
                                       ��
libEGL debug: Gustav Driver name is 
libEGL debug: Gustav fd node type is -1
libEGL debug: Gustav driver IS NOT software driver
libEGL debug: EGL user error 0x3001 (EGL_NOT_INITIALIZED) in eglInitialize: DRI2: gbm device using incorrect/incompatible backend

libEGL debug: EGL user error 0x3001 (EGL_NOT_INITIALIZED) in eglInitialize

EGLDisplay Initialization failed: EGL_NOT_INITIALIZED
(process:3421): GLib-GIO-DEBUG: 21:35:09.847: GSocketClient: Address enumeration succeeded
(process:3421): GLib-GIO-DEBUG: 21:35:09.848: GSocketClient: Starting TCP connection attempt
(process:3421): GLib-GIO-DEBUG: 21:35:09.848: GSocketClient: Connection attempt failed: Network is unreachable
(process:3421): GLib-GIO-DEBUG: 21:35:09.848: GSocketClient: Starting new address enumeration
Gustav PlatformDisplayLibWPE eglGetDisplay(WPEWebProcess:3422): GLib-GIO-DEBUG: 21:35:09.847: Failed to initialize portal (GPowerProfileMonitorPortal) for gio-power-profile-monitor: Not using portals
(process:3421): GLib-GIO-DEBUG: 21:35:09.849: GSocketClient: Address enumeration succeeded
(process:3421): GLib-GIO-DEBUG: 21:35:09.849: GSocketClient: Starting TCP connection attempt
(WPEWebProcess:3422): GLib-GIO-DEBUG: 21:35:09.849: _g_io_module_get_default: Found default implementation dbus (GPowerProfileMonitorDBus) for ?gio-power-profile-monitor?
(process:3421): GLib-GIO-DEBUG: 21:35:09.857: GSocketClient: TCP connection successful
(process:3421): GLib-GIO-DEBUG: 21:35:09.857: GSocketClient: Starting application layer connection
(process:3421): GLib-GIO-DEBUG: 21:35:09.857: GSocketClient: Connection successful!
Cannot create EGL context: invalid display (last error: EGL_SUCCESS)
(process:3421): GLib-GIO-DEBUG: 21:35:09.860: _g_io_module_get_default: Found default implementation openssl (GTlsBackendOpenssl) for ?gio-tls-backend?
Cog-Core-Message: 21:35:09.861: <https://www.google.com/> Load started.
(process:3421): GLib-Net-DEBUG: 21:35:09.862: CLIENT[0x55bc9a2d01b0]: Starting asynchronous TLS handshake
(process:3421): GLib-Net-DEBUG: 21:35:09.862: CLIENT[0x55bc9a2d01b0]: Setting ALPN protocols to \u0002h2\u0008http/1.1\u0008http/1.0
....[Removed log to make it shorter].....
(process:3421): libsoup-http2-DEBUG: 21:35:10.240: [C3-S1] [READ_DONE] Finished: completed
(process:3421): libsoup-http2-DEBUG: 21:35:10.240: [C3-S0] [-] [SEND] [SETTINGS]
(process:3421): GLib-Net-DEBUG: 21:35:10.240: CLIENT[0x55bc9a2d05b0]: starting to write 9 bytes to TLS connection
(process:3421): GLib-Net-DEBUG: 21:35:10.240: CLIENT[0x55bc9a2d05b0]: claiming operation OP_WRITE
(process:3421): GLib-Net-DEBUG: 21:35:10.240: CLIENT[0x55bc9a2d05b0]: claiming operation OP_WRITE succeeded
(process:3421): GLib-Net-DEBUG: 21:35:10.240: CLIENT[0x55bc9a2d05b0]: yielding operation OP_WRITE
(process:3421): GLib-Net-DEBUG: 21:35:10.240: CLIENT[0x55bc9a2d05b0]: successfully write 9 bytes to TLS connection
(process:3421): libsoup-http2-DEBUG: 21:35:10.240: [C3-S0] [-] [SEND] [PING]
(process:3421): GLib-Net-DEBUG: 21:35:10.240: CLIENT[0x55bc9a2d05b0]: starting to write 17 bytes to TLS connection
(process:3421): GLib-Net-DEBUG: 21:35:10.240: CLIENT[0x55bc9a2d05b0]: claiming operation OP_WRITE
(process:3421): GLib-Net-DEBUG: 21:35:10.240: CLIENT[0x55bc9a2d05b0]: claiming operation OP_WRITE succeeded
(process:3421): GLib-Net-DEBUG: 21:35:10.240: CLIENT[0x55bc9a2d05b0]: yielding operation OP_WRITE
(process:3421): GLib-Net-DEBUG: 21:35:10.240: CLIENT[0x55bc9a2d05b0]: successfully write 17 bytes to TLS connection
(process:3421): libsoup-http2-DEBUG: 21:35:10.240: [C3-S0] [-] [SEND] [RST_STREAM] stream_id=1
(process:3421): GLib-Net-DEBUG: 21:35:10.240: CLIENT[0x55bc9a2d05b0]: starting to write 13 bytes to TLS connection
(process:3421): GLib-Net-DEBUG: 21:35:10.240: CLIENT[0x55bc9a2d05b0]: claiming operation OP_WRITE
(process:3421): GLib-Net-DEBUG: 21:35:10.240: CLIENT[0x55bc9a2d05b0]: claiming operation OP_WRITE succeeded
(process:3421): GLib-Net-DEBUG: 21:35:10.240: CLIENT[0x55bc9a2d05b0]: yielding operation OP_WRITE
(process:3421): GLib-Net-DEBUG: 21:35:10.240: CLIENT[0x55bc9a2d05b0]: successfully write 13 bytes to TLS connection
Cog-Core-Message: 21:35:10.248: <https://www.google.com/> Loaded successfully.
^ClibEGL debug: EGL user error 0x3008 (EGL_BAD_DISPLAY) in eglQueryContext

function is no-op
function is no-op
Couldn't open libGL.so.1 or libOpenGL.so.0
./ctest.sh: line 19:  3412 Aborted                 cog --platform-params="renderer=gles" -P drm https://www.google.com
gustavqmatic commented 1 year ago

I try to debug this but I'm not 100% sure how it should behave. I can see that the first display setup is done from Cog and it seems to work as it should. Then a second setup from wpewebkit from PlatformDisplayLibWPE::initialize(). The hostFd is pointing to /dev/dri/card0. The wpe_renderer_backend_egl_create() returns a backend instace and wpe_renderer_backend_egl_get_native_display() a display instance. But wpe_renderer_backend_egl_get_platform() returns 0. I found that a bit odd so I tried to look into libwpe. We use ./usr/lib/libWPEBackend-fdo-1.0.so.1.9.2 as backend (but the yocto build folder is wpebackend-fdo/1.14.0-r0 so I think the version is correct). But here BackendWayland from libWPEBackend-fdo is used. I can only find two backends and the other one is for surfaceless.

Have we misunderstood, is it not possible to run cog in frame buffer mode with egl? If it should work, what should be the overall stack between cog, wpewebkit, libwpe backend?

clopez commented 1 year ago

This error in your log seems it can be problematic: libEGL debug: EGL user error 0x3001 (EGL_NOT_INITIALIZED) in eglInitialize: DRI2: gbm device using incorrect/incompatible backend

Cog works fine with DRM/KMS with other Mesa-based drivers like the Mesa VC4 driver for the RPi 3. If you have one RPi 3 or 4 at hand, then you can try to build Cog for it and see how it works there via KMS/DRM.

Not sure why it is not working for you on Intel, in theory it should work (AFAIK).

gustavqmatic commented 1 year ago

Thank you for the response. We have decided to use Wayland instead of DRM, so I will close this issue.