vtest: tidy up vtest_resource_busy_wait a bit

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
Reviewed-by: Ryan Neph <ryanneph@google.com>
Reviewed-by: Gert Wollny <gert.wollny@collabora.com>
macos/master
Chia-I Wu 4 years ago
parent 76b87509b2
commit 0e6029757b
  1. 28
      vtest/vtest_renderer.c

@ -1399,24 +1399,18 @@ int vtest_resource_busy_wait(UNUSED uint32_t length_dw)
/* handle = bw_buf[VCMD_BUSY_WAIT_HANDLE]; unused as of now */ /* handle = bw_buf[VCMD_BUSY_WAIT_HANDLE]; unused as of now */
flags = bw_buf[VCMD_BUSY_WAIT_FLAGS]; flags = bw_buf[VCMD_BUSY_WAIT_FLAGS];
if (flags == VCMD_BUSY_WAIT_FLAG_WAIT) { do {
do {
if (renderer.last_fence == (renderer.fence_id - 1)) {
break;
}
fd = virgl_renderer_get_poll_fd();
if (fd != -1) {
vtest_wait_for_fd_read(fd);
}
virgl_renderer_poll();
} while (1);
busy = false;
} else {
busy = renderer.last_fence != (renderer.fence_id - 1); busy = renderer.last_fence != (renderer.fence_id - 1);
} if (!busy || !(flags & VCMD_BUSY_WAIT_FLAG_WAIT))
break;
/* TODO this is bad when there are multiple clients */
fd = virgl_renderer_get_poll_fd();
if (fd != -1) {
vtest_wait_for_fd_read(fd);
}
virgl_renderer_poll();
} while (true);
hdr_buf[VTEST_CMD_LEN] = 1; hdr_buf[VTEST_CMD_LEN] = 1;
hdr_buf[VTEST_CMD_ID] = VCMD_RESOURCE_BUSY_WAIT; hdr_buf[VTEST_CMD_ID] = VCMD_RESOURCE_BUSY_WAIT;

Loading…
Cancel
Save