diff --git a/tests/test_virgl_cmd.c b/tests/test_virgl_cmd.c index 816e5dc..4a96dfc 100644 --- a/tests/test_virgl_cmd.c +++ b/tests/test_virgl_cmd.c @@ -1040,6 +1040,9 @@ int main(void) SRunner *sr; int number_failed; + if (getenv("VRENDTEST_USE_EGL_SURFACELESS")) + context_flags |= VIRGL_RENDERER_USE_SURFACELESS; + s = virgl_init_suite(); sr = srunner_create(s); diff --git a/tests/test_virgl_init.c b/tests/test_virgl_init.c index e777810..55763a3 100644 --- a/tests/test_virgl_init.c +++ b/tests/test_virgl_init.c @@ -74,7 +74,7 @@ START_TEST(virgl_init_egl) { int ret; test_cbs.version = 1; - ret = virgl_renderer_init(&mystruct, VIRGL_RENDERER_USE_EGL, &test_cbs); + ret = virgl_renderer_init(&mystruct, context_flags, &test_cbs); ck_assert_int_eq(ret, 0); virgl_renderer_cleanup(&mystruct); } @@ -85,7 +85,7 @@ START_TEST(virgl_init_egl_create_ctx) { int ret; test_cbs.version = 1; - ret = virgl_renderer_init(&mystruct, VIRGL_RENDERER_USE_EGL, &test_cbs); + ret = virgl_renderer_init(&mystruct, context_flags, &test_cbs); ck_assert_int_eq(ret, 0); ret = virgl_renderer_context_create(1, strlen("test1"), "test1"); ck_assert_int_eq(ret, 0); @@ -100,7 +100,7 @@ START_TEST(virgl_init_egl_create_ctx_0) int ret; test_cbs.version = 1; - ret = virgl_renderer_init(&mystruct, VIRGL_RENDERER_USE_EGL, &test_cbs); + ret = virgl_renderer_init(&mystruct, context_flags, &test_cbs); ck_assert_int_eq(ret, 0); ret = virgl_renderer_context_create(0, strlen("test1"), "test1"); ck_assert_int_eq(ret, EINVAL); @@ -113,7 +113,7 @@ START_TEST(virgl_init_egl_destroy_ctx_illegal) { int ret; test_cbs.version = 1; - ret = virgl_renderer_init(&mystruct, VIRGL_RENDERER_USE_EGL, &test_cbs); + ret = virgl_renderer_init(&mystruct, context_flags, &test_cbs); ck_assert_int_eq(ret, 0); virgl_renderer_context_destroy(1); @@ -259,7 +259,7 @@ START_TEST(virgl_init_get_caps_set0) uint32_t max_ver, max_size; test_cbs.version = 1; - ret = virgl_renderer_init(&mystruct, VIRGL_RENDERER_USE_EGL, &test_cbs); + ret = virgl_renderer_init(&mystruct, context_flags, &test_cbs); ck_assert_int_eq(ret, 0); virgl_renderer_get_cap_set(0, &max_ver, &max_size); @@ -276,7 +276,7 @@ START_TEST(virgl_init_get_caps_set1) uint32_t max_ver, max_size; void *caps; test_cbs.version = 1; - ret = virgl_renderer_init(&mystruct, VIRGL_RENDERER_USE_EGL, &test_cbs); + ret = virgl_renderer_init(&mystruct, context_flags, &test_cbs); ck_assert_int_eq(ret, 0); virgl_renderer_get_cap_set(1, &max_ver, &max_size); @@ -299,7 +299,7 @@ START_TEST(virgl_init_get_caps_null) uint32_t max_ver, max_size; test_cbs.version = 1; - ret = virgl_renderer_init(&mystruct, VIRGL_RENDERER_USE_EGL, &test_cbs); + ret = virgl_renderer_init(&mystruct, context_flags, &test_cbs); ck_assert_int_eq(ret, 0); virgl_renderer_get_cap_set(1, &max_ver, &max_size); @@ -432,7 +432,7 @@ START_TEST(virgl_init_egl_create_ctx_create_attach_res_illegal_res) struct iovec iovs[1]; test_cbs.version = 1; - ret = virgl_renderer_init(&mystruct, VIRGL_RENDERER_USE_EGL, &test_cbs); + ret = virgl_renderer_init(&mystruct, context_flags, &test_cbs); ck_assert_int_eq(ret, 0); ret = virgl_renderer_resource_attach_iov(1, iovs, 1); @@ -495,6 +495,9 @@ int main(void) SRunner *sr; int number_failed; + if (getenv("VRENDTEST_USE_EGL_SURFACELESS")) + context_flags |= VIRGL_RENDERER_USE_SURFACELESS; + s = virgl_init_suite(); sr = srunner_create(s); diff --git a/tests/test_virgl_resource.c b/tests/test_virgl_resource.c index 007bff2..ec69038 100644 --- a/tests/test_virgl_resource.c +++ b/tests/test_virgl_resource.c @@ -309,6 +309,9 @@ int main(void) SRunner *sr; int number_failed; + if (getenv("VRENDTEST_USE_EGL_SURFACELESS")) + context_flags |= VIRGL_RENDERER_USE_SURFACELESS; + s = virgl_init_suite(); sr = srunner_create(s); diff --git a/tests/test_virgl_transfer.c b/tests/test_virgl_transfer.c index 2bd2cc7..e4bf2f5 100644 --- a/tests/test_virgl_transfer.c +++ b/tests/test_virgl_transfer.c @@ -781,6 +781,9 @@ int main(void) SRunner *sr; int number_failed; + if (getenv("VRENDTEST_USE_EGL_SURFACELESS")) + context_flags |= VIRGL_RENDERER_USE_SURFACELESS; + s = virgl_init_suite(); sr = srunner_create(s); diff --git a/tests/testvirgl.c b/tests/testvirgl.c index aea386a..971f1fb 100644 --- a/tests/testvirgl.c +++ b/tests/testvirgl.c @@ -35,6 +35,8 @@ #include "virgl_hw.h" #include "virglrenderer.h" +int context_flags = VIRGL_RENDERER_USE_EGL; + void testvirgl_init_simple_1d_resource(struct virgl_renderer_resource_create_args *res, int handle) { res->handle = handle; @@ -116,7 +118,7 @@ int testvirgl_init_single_ctx(void) test_cbs.version = 1; test_cbs.write_fence = testvirgl_write_fence; - ret = virgl_renderer_init(&mystruct, VIRGL_RENDERER_USE_EGL, &test_cbs); + ret = virgl_renderer_init(&mystruct, context_flags, &test_cbs); ck_assert_int_eq(ret, 0); if (ret) return ret; diff --git a/tests/testvirgl.h b/tests/testvirgl.h index 3baf724..108a5f8 100644 --- a/tests/testvirgl.h +++ b/tests/testvirgl.h @@ -30,6 +30,8 @@ #define VIRGL_MAX_CMDBUF_DWORDS (16*1024) +extern int context_flags; + struct virgl_cmd_buf { unsigned cdw; uint32_t *buf;