egl/surfaceless: try kms_swrast before swrast
Before commitf7e0cdcf1a
, we tried these in order - if (!ForceSoftware) surfaceless_probe_device(disp, false); - surfaceless_probe_device(disp, true); - surfaceless_probe_device_sw(disp); The commit changed it to - surfaceless_probe_device(disp, ForceSoftware); - surfaceless_probe_device_sw(disp); and broke 2D virtio-gpu and vgem when ForceSoftware is false. This commit restores the old behavior. Fixes:f7e0cdcf1a
("egl/surfaceless: simplify dri2_initialize_surfaceless()") Signed-off-by: Chia-I Wu <olvaffe@gmail.com> Reviewed-by: Adam Jackson <ajax@redhat.com> Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11992>
This commit is contained in:
@@ -327,14 +327,18 @@ dri2_initialize_surfaceless(_EGLDisplay *disp)
|
|||||||
dri2_dpy->fd = -1;
|
dri2_dpy->fd = -1;
|
||||||
disp->DriverData = (void *) dri2_dpy;
|
disp->DriverData = (void *) dri2_dpy;
|
||||||
|
|
||||||
|
/* When ForceSoftware is false, we try the HW driver. When ForceSoftware
|
||||||
|
* is true, we try kms_swrast and swrast in order.
|
||||||
|
*/
|
||||||
driver_loaded = surfaceless_probe_device(disp, disp->Options.ForceSoftware);
|
driver_loaded = surfaceless_probe_device(disp, disp->Options.ForceSoftware);
|
||||||
|
if (!driver_loaded && disp->Options.ForceSoftware) {
|
||||||
|
_eglLog(_EGL_DEBUG, "Falling back to surfaceless swrast without DRM.");
|
||||||
|
driver_loaded = surfaceless_probe_device_sw(disp);
|
||||||
|
}
|
||||||
|
|
||||||
if (!driver_loaded) {
|
if (!driver_loaded) {
|
||||||
_eglLog(_EGL_DEBUG, "Falling back to surfaceless swrast without DRM.");
|
err = "DRI2: failed to load driver";
|
||||||
if (!surfaceless_probe_device_sw(disp)) {
|
goto cleanup;
|
||||||
err = "DRI2: failed to load driver";
|
|
||||||
goto cleanup;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!dri2_create_screen(disp)) {
|
if (!dri2_create_screen(disp)) {
|
||||||
|
Reference in New Issue
Block a user