Failed to create EGL image from dmabuf
After updating Wayfire to use wlroots 0.15.0, output mirroring stopped working on my laptop (Intel UHD620, Mesa 21.3.4, Fedora 35). The errors I am getting are:
EE 31-01-22 14:06:52.660 - [EGL] command: eglCreateImageKHR, error: EGL_BAD_ALLOC (0x3003), message: "dri2_create_image_khr_texture"
EE 31-01-22 14:06:52.660 - [render/egl.c:725] eglCreateImageKHR failed
EE 31-01-22 14:06:52.660 - [render/gles2/texture.c:271] Failed to create EGL image from DMA-BUF
The relevant code in Wayfire is here: https://github.com/WayfireWM/wayfire/blob/master/src/core/output-layout.cpp#L672
On output commit, Wayfire locks the output's new buffer, if there is a new buffer, and unlocks any previously held buffer.
However, the wlr_texture_from_dmabuf
function fails with the errors above.
Other people have also reported the issue in Wayfire: https://github.com/WayfireWM/wayfire/issues/1408
I spent 2 hours trying to bisect this, but the behavior was weird - it seemed like some combinations work sometimes, other times they don't. However, with wlroots 0.14.0 and Wayfire 0.7.2 everything works perfectly every time, so I think this may also be a regression in wlroots. Any ideas how to debug?