From f8a2c576923c05643cecc767a756f534d00d4b65 Mon Sep 17 00:00:00 2001 From: Dave Airlie Date: Fri, 13 Mar 2015 17:59:30 +1000 Subject: [PATCH] vtest: hook up cmd submit --- vtest/vtest.h | 1 + vtest/vtest_renderer.c | 19 +++++++++++++++++++ vtest/vtest_server.c | 3 +++ 3 files changed, 23 insertions(+) diff --git a/vtest/vtest.h b/vtest/vtest.h index d599a05..9f9300f 100644 --- a/vtest/vtest.h +++ b/vtest/vtest.h @@ -7,5 +7,6 @@ int vtest_send_caps(void); int vtest_create_resource(void); int vtest_resource_unref(void); +int vtest_submit_cmd(uint32_t length_dw); #endif diff --git a/vtest/vtest_renderer.c b/vtest/vtest_renderer.c index dbbe20a..eb5aea3 100644 --- a/vtest/vtest_renderer.c +++ b/vtest/vtest_renderer.c @@ -93,3 +93,22 @@ int vtest_resource_unref(void) virgl_renderer_resource_unref(handle); return 0; } + +int vtest_submit_cmd(uint32_t length_dw) +{ + uint32_t *cbuf; + int ret; + + cbuf = malloc(length_dw * 4); + if (!cbuf) + return -1; + + ret = read(renderer.remote_fd, cbuf, length_dw * 4); + if (ret != length_dw * 4) + return -1; + + virgl_renderer_submit_cmd(cbuf, ctx_id, length_dw); + + free(cbuf); + return 0; +} diff --git a/vtest/vtest_server.c b/vtest/vtest_server.c index a702139..ee2e33c 100644 --- a/vtest/vtest_server.c +++ b/vtest/vtest_server.c @@ -105,6 +105,9 @@ again: case VCMD_RESOURCE_UNREF: vtest_resource_unref(); break; + case VCMD_SUBMIT_CMD: + vtest_submit_cmd(header[0]); + break; default: break; }