vtest: only create fence before it's needed

Just as bad as waiting only for the last fence, after all.

Signed-off-by: Marc-André Lureau <marcandre.lureau@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
macos/master
Marc-André Lureau 9 years ago committed by Dave Airlie
parent 47559de28d
commit a603f027aa
  1. 7
      vtest/vtest_server.c

@ -89,7 +89,6 @@ int run_renderer(int new_fd)
{ {
int ret; int ret;
uint32_t header[VTEST_HDR_SIZE]; uint32_t header[VTEST_HDR_SIZE];
bool do_fence;
bool inited = false; bool inited = false;
again: again:
ret = vtest_wait_for_fd_read(new_fd); ret = vtest_wait_for_fd_read(new_fd);
@ -106,7 +105,6 @@ again:
inited = true; inited = true;
} }
vtest_poll(); vtest_poll();
do_fence = false;
switch (header[1]) { switch (header[1]) {
case VCMD_GET_CAPS: case VCMD_GET_CAPS:
ret = vtest_send_caps(); ret = vtest_send_caps();
@ -119,16 +117,15 @@ again:
break; break;
case VCMD_SUBMIT_CMD: case VCMD_SUBMIT_CMD:
ret = vtest_submit_cmd(header[0]); ret = vtest_submit_cmd(header[0]);
do_fence = true;
break; break;
case VCMD_TRANSFER_GET: case VCMD_TRANSFER_GET:
ret = vtest_transfer_get(header[0]); ret = vtest_transfer_get(header[0]);
break; break;
case VCMD_TRANSFER_PUT: case VCMD_TRANSFER_PUT:
ret = vtest_transfer_put(header[0]); ret = vtest_transfer_put(header[0]);
do_fence = true;
break; break;
case VCMD_RESOURCE_BUSY_WAIT: case VCMD_RESOURCE_BUSY_WAIT:
vtest_renderer_create_fence();
ret = vtest_resource_busy_wait(); ret = vtest_resource_busy_wait();
break; break;
default: default:
@ -139,8 +136,6 @@ again:
goto fail; goto fail;
} }
if (do_fence)
vtest_renderer_create_fence();
goto again; goto again;
} }
if (ret <= 0) { if (ret <= 0) {

Loading…
Cancel
Save