summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarc-André Lureau <marcandre.lureau@gmail.com>2015-12-15 17:56:29 +0100
committerDave Airlie <airlied@redhat.com>2015-12-22 09:11:38 +1000
commit83faf22c16677db5afd897e3f6c99c5db0c8c62d (patch)
tree5e65e90067f5606e9d5b71f3aa7bc7ab39a8ce13
parentaa34024038495b49211d04b3f184b4714d814b38 (diff)
tests: reset last fence before using it
Signed-off-by: Marc-André Lureau <marcandre.lureau@gmail.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
-rw-r--r--tests/test_virgl_cmd.c3
-rw-r--r--tests/testvirgl.c5
-rw-r--r--tests/testvirgl.h1
3 files changed, 9 insertions, 0 deletions
diff --git a/tests/test_virgl_cmd.c b/tests/test_virgl_cmd.c
index c91d70a..28ca3b9 100644
--- a/tests/test_virgl_cmd.c
+++ b/tests/test_virgl_cmd.c
@@ -430,6 +430,7 @@ START_TEST(virgl_test_render_simple)
virgl_renderer_submit_cmd(ctx.cbuf->buf, ctx.ctx_id, ctx.cbuf->cdw);
/* create a fence */
+ testvirgl_reset_fence();
ret = virgl_renderer_create_fence(1, ctx.ctx_id);
ck_assert_int_eq(ret, 0);
@@ -686,6 +687,7 @@ START_TEST(virgl_test_render_geom_simple)
virgl_renderer_submit_cmd(ctx.cbuf->buf, ctx.ctx_id, ctx.cbuf->cdw);
/* create a fence */
+ testvirgl_reset_fence();
ret = virgl_renderer_create_fence(1, ctx.ctx_id);
ck_assert_int_eq(ret, 0);
@@ -930,6 +932,7 @@ START_TEST(virgl_test_render_xfb)
virgl_renderer_submit_cmd(ctx.cbuf->buf, ctx.ctx_id, ctx.cbuf->cdw);
/* create a fence */
+ testvirgl_reset_fence();
ret = virgl_renderer_create_fence(1, ctx.ctx_id);
ck_assert_int_eq(ret, 0);
diff --git a/tests/testvirgl.c b/tests/testvirgl.c
index 6e69479..03b31e0 100644
--- a/tests/testvirgl.c
+++ b/tests/testvirgl.c
@@ -104,6 +104,11 @@ uint32_t testvirgl_get_last_fence(void)
return testvirgl_last_fence;
}
+void testvirgl_reset_fence(void)
+{
+ testvirgl_last_fence = 0;
+}
+
int testvirgl_init_single_ctx(void)
{
int ret;
diff --git a/tests/testvirgl.h b/tests/testvirgl.h
index a2b0ffe..64f0a8e 100644
--- a/tests/testvirgl.h
+++ b/tests/testvirgl.h
@@ -65,6 +65,7 @@ void testvirgl_init_single_ctx_nr(void);
void testvirgl_fini_single_ctx(void);
uint32_t testvirgl_get_last_fence(void);
+void testvirgl_reset_fence(void);
int testvirgl_init_ctx_cmdbuf(struct virgl_context *ctx);
void testvirgl_fini_ctx_cmdbuf(struct virgl_context *ctx);