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>
goto cleanup;
}
- dev = _eglAddDevice(dri2_dpy->fd, disp->Options.ForceSoftware);
+ dev = _eglAddDevice(dri2_dpy->fd, dri2_dpy->gbm_dri->software);
if (!dev) {
err = "DRI2: failed to find EGLDevice";
goto cleanup;
return -errno;
ret = dri_screen_create_dri2(dri, driver_name);
- if (ret == 0)
+ if (ret != 0)
+ ret = dri_screen_create_swrast(dri);
+ if (ret != 0)
return ret;
- return dri_screen_create_swrast(dri);
+ dri->software = true;
+ return 0;
}
static const struct gbm_dri_visual gbm_dri_visuals_table[] = {
void *driver;
char *driver_name; /* Name of the DRI module, without the _dri suffix */
+ bool software; /* A software driver was loaded */
__DRIscreen *screen;
__DRIcontext *context;