virgl/vtest: change interface of virgl_vtest_submit_cmd

Instead of passing the whole command buffer structure just pass
the actual command stream buffer and its size. With that we can
submit a command ad-hoc.

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31624>
This commit is contained in:
Gert Wollny 2024-10-16 12:59:24 +02:00 committed by Marge Bot
parent a32de23a9d
commit 8b33eece30
3 changed files with 7 additions and 7 deletions

View File

@ -380,15 +380,14 @@ int virgl_vtest_send_resource_create(struct virgl_vtest_winsys *vws,
}
int virgl_vtest_submit_cmd(struct virgl_vtest_winsys *vws,
struct virgl_vtest_cmd_buf *cbuf)
uint32_t *buf, uint32_t buf_len)
{
uint32_t vtest_hdr[VTEST_HDR_SIZE];
vtest_hdr[VTEST_CMD_LEN] = cbuf->base.cdw;
vtest_hdr[VTEST_CMD_LEN] = buf_len;
vtest_hdr[VTEST_CMD_ID] = VCMD_SUBMIT_CMD;
virgl_block_write(vws->sock_fd, &vtest_hdr, sizeof(vtest_hdr));
virgl_block_write(vws->sock_fd, cbuf->buf, cbuf->base.cdw * 4);
virgl_block_write(vws->sock_fd, buf, 4 * buf_len);
return 0;
}

View File

@ -533,7 +533,7 @@ static int virgl_vtest_winsys_submit_cmd(struct virgl_winsys *vws,
if (cbuf->base.cdw == 0)
return 0;
ret = virgl_vtest_submit_cmd(vtws, cbuf);
ret = virgl_vtest_submit_cmd(vtws, cbuf->base.buf, cbuf->base.cdw);
if (fence && ret == 0)
*fence = virgl_vtest_fence_create(vws);

View File

@ -120,8 +120,9 @@ int virgl_vtest_send_resource_create(struct virgl_vtest_winsys *vws,
int virgl_vtest_send_resource_unref(struct virgl_vtest_winsys *vws,
uint32_t handle);
int virgl_vtest_submit_cmd(struct virgl_vtest_winsys *vtws,
struct virgl_vtest_cmd_buf *cbuf);
int virgl_vtest_submit_cmd(struct virgl_vtest_winsys *vws,
uint32_t *buf, uint32_t buf_len);
int virgl_vtest_send_transfer_get(struct virgl_vtest_winsys *vws,
uint32_t handle,