tests: add fence handling

This adds a basic fence handling interface.
macos/master
Dave Airlie 10 years ago
parent bdb49d5636
commit fcaeadc4ad
  1. 12
      tests/testvirgl.c
  2. 2
      tests/testvirgl.h

@ -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)

@ -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);

Loading…
Cancel
Save