gitlab-ci: Test virgl driver

Add virglrenderer to the container and use the vtest transport to test
the Gallium driver. On the "host", llvmpipe is used.

Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4433>
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index c2b73bc..7cb88dd 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -19,6 +19,7 @@
   - panfrost
   - radv
   - lima
+  - virgl
   - success
 
 
@@ -145,7 +146,7 @@
 x86_test-gl:
   extends: x86_build
   variables:
-    FDO_DISTRIBUTION_TAG: &x86_test-gl "2020-03-18-jflags"
+    FDO_DISTRIBUTION_TAG: &x86_test-gl "2020-04-20"
 
 # Debian 10 based x86 test image for VK
 x86_test-vk:
@@ -309,7 +310,7 @@
       -D platforms=x11,drm,surfaceless
     GALLIUM_ST: >
       -D dri3=true
-    GALLIUM_DRIVERS: "swrast"
+    GALLIUM_DRIVERS: "swrast,virgl"
     VULKAN_DRIVERS: amd
     BUILDTYPE: "debugoptimized"
     EXTRA_OPTION: >
@@ -713,6 +714,31 @@
     DEQP_VER: gles31
   extends: softpipe-gles2
 
+virgl-gles2:
+  variables:
+    DEQP_VER: gles2
+    DEQP_PARALLEL: 4
+    NIR_VALIDATE: 0
+    DEQP_NO_SAVE_RESULTS: 1
+    DEQP_RUNNER_OPTIONS: "--compact-display false"
+    # Don't use threads inside llvmpipe, we've already got all 4 cores
+    # busy with DEQP_PARALLEL.
+    LP_NUM_THREADS: 0
+    DEQP_EXPECTED_FAILS: deqp-virgl-fails.txt
+    LIBGL_ALWAYS_SOFTWARE: "true"
+    GALLIUM_DRIVER: "virpipe"
+  extends:
+    - .deqp-test-gl
+    - .virgl-rules
+
+virgl-gles3:
+  variables:
+    DEQP_VER: gles3
+    CI_NODE_INDEX: 1
+    CI_NODE_TOTAL: 3
+    DEQP_RUNNER_OPTIONS: "--compact-display false --timeout 120"
+  extends: virgl-gles2
+
 # Rules for tests that should not be present in MRs or the main
 # project's pipeline (don't block marge or report red on
 # mesa/mesamaster) but should be present on pipelines in personal