diff --git a/tests/testvirgl.c b/tests/testvirgl.c index 60233ed..f0d44eb 100644 --- a/tests/testvirgl.c +++ b/tests/testvirgl.c @@ -93,11 +93,23 @@ static struct myinfo_struct mystruct; static struct virgl_renderer_callbacks test_cbs; +static uint32_t testvirgl_last_fence; +static void testvirgl_write_fence(void *cookie, uint32_t fence) +{ + testvirgl_last_fence = fence; +} + +uint32_t testvirgl_get_last_fence(void) +{ + return testvirgl_last_fence; +} + int testvirgl_init_single_ctx(void) { int ret; test_cbs.version = 1; + test_cbs.write_fence = testvirgl_write_fence; ret = virgl_renderer_init(&mystruct, VIRGL_RENDERER_USE_EGL, &test_cbs); ck_assert_int_eq(ret, 0); if (ret) diff --git a/tests/testvirgl.h b/tests/testvirgl.h index 4043e2c..1b0b3b0 100644 --- a/tests/testvirgl.h +++ b/tests/testvirgl.h @@ -63,6 +63,8 @@ int testvirgl_init_single_ctx(void); void testvirgl_init_single_ctx_nr(void); void testvirgl_fini_single_ctx(void); +uint32_t testvirgl_get_last_fence(void); + int testvirgl_init_ctx_cmdbuf(struct virgl_context *ctx); void testvirgl_fini_ctx_cmdbuf(struct virgl_context *ctx);