egl/sl: also allow virtgpu to fallback to kms_swrast
authorGurchetan Singh <gurchetansingh@chromium.org>
Sat, 2 Mar 2019 02:58:16 +0000 (18:58 -0800)
committerGurchetan Singh <gurchetansingh@chromium.org>
Mon, 4 Mar 2019 17:33:17 +0000 (17:33 +0000)
virtio-gpu fallbacks to software rendering when 3D features
are unavailable since 6c5ab, and kms_swrast is more
feature complete than swrast.

v2: Add comment (Emil)

Reviewed-by: Eric Engestrom <eric@engestrom.ch>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
src/egl/drivers/dri2/platform_surfaceless.c

index 4fe364ab22e7b24e1db2bbeab36ac1c8b91833c6..fefb2b449d05f97c59f23378117233755270a048 100644 (file)
@@ -301,8 +301,13 @@ surfaceless_probe_device(_EGLDisplay *disp, bool swrast)
 
       char *driver_name = loader_get_driver_for_fd(dri2_dpy->fd);
       if (swrast) {
-         /* Use kms swrast only with vgem */
-         if (strcmp(driver_name, "vgem") == 0)
+         /* Use kms swrast only with vgem / virtio_gpu.
+          * virtio-gpu fallbacks to software rendering when 3D features
+          * are unavailable since 6c5ab, and kms_swrast is more
+          * feature complete than swrast.
+          */
+         if (strcmp(driver_name, "vgem") == 0 ||
+             strcmp(driver_name, "virtio_gpu") == 0)
             dri2_dpy->driver_name = strdup("kms_swrast");
          free(driver_name);
       } else {