From 42aae37faaede393ae31abf6e3fb9601967d2c25 Mon Sep 17 00:00:00 2001 From: Chia-I Wu Date: Tue, 6 Oct 2020 15:12:06 -0700 Subject: [PATCH] vtest: fence is not needed for resource creation There is never a need to wait for the GPU works (if any) involved in resource creation. A client commonly does VCMD_SUBMIT_CMD VCMD_RESOURCE_CREATE2(dummy) ... VCMD_RESOURCE_BUSY_WAIT(dummy) only because VCMD_RESOURCE_BUSY_WAIT needs a resource. We don't need a fence for resource creation. Signed-off-by: Chia-I Wu Reviewed-by: Ryan Neph Reviewed-by: Gert Wollny --- vtest/vtest_renderer.c | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/vtest/vtest_renderer.c b/vtest/vtest_renderer.c index 2e2d082..9d56623 100644 --- a/vtest/vtest_renderer.c +++ b/vtest/vtest_renderer.c @@ -94,13 +94,8 @@ struct vtest_renderer { }; /* - * A fence is created after - * - * - VCMD_RESOURCE_CREATE - * - VCMD_RESOURCE_CREATE2 - * - VCMD_SUBMIT_CMD - * - * for VCMD_RESOURCE_BUSY_WAIT to wait on. + * VCMD_RESOURCE_BUSY_WAIT is used to wait GPU works (VCMD_SUBMIT_CMD) or CPU + * works (VCMD_TRANSFER_GET2). A fence is needed only for GPU works. */ static void vtest_renderer_create_fence(struct vtest_renderer *renderer) { @@ -900,9 +895,6 @@ static int vtest_create_resource_internal(struct vtest_context *ctx, util_hash_table_set(ctx->resource_table, intptr_to_pointer(res->res_id), res); - if (cmd_id == VCMD_RESOURCE_CREATE || cmd_id == VCMD_RESOURCE_CREATE2) - vtest_renderer_create_fence(&renderer); - return 0; }