Using EGL_KHR_surfaceless_context causes spurious "libEGL warning: FIXME: egl/x11 doesn't support front buffer rendering."
Submitted by Pekka Paalanen
Assigned to Ian Romanick
I was reviewing a patch to Weston to use EGL_KHR_surfaceless_context for making a context current while there are no outputs whose EGLSurface could be used. Weston does not use front buffer rendering.
Looks like this causes a spurious warning: libEGL warning: FIXME: egl/x11 doesn't support front buffer rendering.
The stack trace is:
#0 0x00007ffff36f7b80 in dri3_flush_front_buffer () from /usr/lib64/libEGL.so.1 #1 0x00007fffeff0be8c in intel_flush_front () from /usr/lib64/dri/i965_dri.so #2 0x00007fffeff0bedd in intel_glFlush () from /usr/lib64/dri/i965_dri.so #3 0x00007ffff36ef881 in dri2_make_current () from /usr/lib64/libEGL.so.1 #4 0x00007ffff36e9ceb in eglMakeCurrent () from /usr/lib64/libEGL.so.1 #5 0x00007ffff054b275 in use_output (output=<optimized out>) at /home/pq/git/weston/libweston/gl-renderer.c:670 #6 0x00007ffff054c035 in gl_renderer_repaint_output (output=0x807320, output_damage=0x7fffffffd380) at /home/pq/git/weston/libweston/gl-renderer.c:1096 #7 0x00007ffff57866d9 in x11_output_repaint_gl (output_base=0x807320, damage=0x7fffffffd380) at /home/pq/git/weston/libweston/compositor-x11.c:380 #8 0x00007ffff7bc1e34 in weston_output_repaint (output=0x807320) at /home/pq/git/weston/libweston/compositor.c:2266 #9 output_repaint_timer_handler (data=0x807320) at /home/pq/git/weston/libweston/compositor.c:2305 #10 0x00007ffff79a7e29 in wl_event_source_timer_dispatch (source=0x7faab0, ep=<optimized out>) at src/event-loop.c:182 #11 0x00007ffff79a8432 in wl_event_loop_dispatch (loop=0x611200, timeout=timeout@entry=-1) at src/event-loop.c:422 #12 0x00007ffff79a6c05 in wl_display_run (display=display@entry=0x611170) at src/wayland-server.c:1051 #13 0x0000000000405426 in main (argc=1, argv=<optimized out>) at /home/pq/git/weston/compositor/main.c:1737
Weston sets up the gl-renderer with a EGL_NO_SURFACE made current, and later when repainting the real X11 window for the first time I believe, the warning triggers once. In the backtrace I see that the warning happens when eglMakeCurrent is called with the real EGLSurface. I suspect Mesa tries to flush the old context first, and somehow having EGL_NO_SURFACE bound causes it to think it is doing front buffer rendering, while it was in fact doing no-buffer-rendering.
If I force Weston to use the fallback path by creating a pbuffer instead of using EGL_NO_SURFACE, the warning does not appear.
The warning was added to Mesa in commit f35198ba. I am using Mesa 11.2.2 as packaged in Gentoo.
Because in the backtrace it looks like the decision to flush the front is made inside the intel driver, I picked that as the component.