Skip to content

egl/gbm: Walk device list to initialize DRM platform

Alessandro Astone requested to merge aleasto/mesa:egl-gbm-platform into main

We cannot always use /dev/dri/card0. As a matter of fact, on systems with SimpleDRM enabled /dev/dri/card0 will be created by it and removed once a GPU driver has loaded.

In any case we shouldn't hard-code the device number and instead walk the device list to find the first suitable device.

This issue is trivially reproducible with eglinfo -B -p gbm on Ubuntu 24.04 or Fedora 40

Fixes: 32f4cf38 ("egl/gbm: Fix EGL_DEFAULT_DISPLAY")

Edited by Alessandro Astone

Merge request reports