egl: fix software flag in _eglAddDevice call on DRM
authorSimon Ser <contact@emersion.fr>
Thu, 18 Mar 2021 20:48:44 +0000 (21:48 +0100)
committerMarge Bot <eric+marge@anholt.net>
Fri, 26 Mar 2021 10:32:31 +0000 (10:32 +0000)
commit08a51770bd1b39262003a14850d416df04d13ac7
treed9765da3b30b5c925231c0d821425b0e6b9a12ed
parent6298347ec71e7e03c02bf262f37d176dbcc2b987
egl: fix software flag in _eglAddDevice call on DRM

On the EGL DRM platform, call _eglAddDevice with the software flag
set if GBM has loaded a software driver. This allows _eglAddDevice
to make the difference between llvmpipe and kmsro.

This is important on split render/display SoCs: we don't want to
advertise EGL_MESA_device_software on these systems.

Completely drop disp->Options.ForceSoftware, because GBM is
responsible for choosing software rendering and doesn't take this
hint into account.

Signed-off-by: Simon Ser <contact@emersion.fr>
Fixes: 5743a36b2b32 ("egl: Don't add hardware device if there is no render node v2.")
References: https://gitlab.freedesktop.org/mesa/mesa/-/issues/4178
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9697>
src/egl/drivers/dri2/platform_drm.c
src/gbm/backends/dri/gbm_dri.c
src/gbm/backends/dri/gbm_driint.h