[virglrenderer-devel] [PATCH 2/4] vtest: add VTEST_USE_GLX environment variable

marcandre.lureau at redhat.com marcandre.lureau at redhat.com
Fri Jun 10 17:25:01 UTC 2016


From: Marc-André Lureau <marcandre.lureau at redhat.com>

Allows to select the glx backend with vtest.

Signed-off-by: Marc-André Lureau <marcandre.lureau at redhat.com>
---
 vtest/vtest_renderer.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/vtest/vtest_renderer.c b/vtest/vtest_renderer.c
index 91c6c35..3b8fe1a 100644
--- a/vtest/vtest_renderer.c
+++ b/vtest/vtest_renderer.c
@@ -113,13 +113,16 @@ int vtest_create_renderer(int in_fd, int out_fd, uint32_t length)
 {
     char *vtestname;
     int ret;
+    int ctx = VIRGL_RENDERER_USE_EGL;
 
     renderer.in_fd = in_fd;
     renderer.out_fd = out_fd;
 
+    if (getenv("VTEST_USE_GLX"))
+       ctx = VIRGL_RENDERER_USE_GLX;
+
     ret = virgl_renderer_init(&renderer,
-                              VIRGL_RENDERER_USE_EGL |
-                              VIRGL_RENDERER_THREAD_SYNC, &vtest_cbs);
+                              ctx | VIRGL_RENDERER_THREAD_SYNC, &vtest_cbs);
     if (ret) {
       fprintf(stderr, "failed to initialise renderer.\n");
       return -1;
-- 
2.7.4



More information about the virglrenderer-devel mailing list