diff --git a/vtest/vtest.h b/vtest/vtest.h index 327c193..8a4a425 100644 --- a/vtest/vtest.h +++ b/vtest/vtest.h @@ -42,6 +42,8 @@ int vtest_resource_busy_wait(void); int vtest_renderer_create_fence(void); int vtest_poll(void); +int vtest_ping_protocol_version(void); + void vtest_destroy_renderer(void); #endif diff --git a/vtest/vtest_protocol.h b/vtest/vtest_protocol.h index f617643..78eaf84 100644 --- a/vtest/vtest_protocol.h +++ b/vtest/vtest_protocol.h @@ -54,6 +54,8 @@ /* 0 length cmd */ /* resp VCMD_GET_CAPS + caps */ +#define VCMD_PING_PROTOCOL_VERSION 10 + #define VCMD_RES_CREATE_SIZE 10 #define VCMD_RES_CREATE_RES_HANDLE 0 #define VCMD_RES_CREATE_TARGET 1 @@ -88,4 +90,6 @@ #define VCMD_BUSY_WAIT_HANDLE 0 #define VCMD_BUSY_WAIT_FLAGS 1 +#define VCMD_PING_PROTOCOL_VERSION_SIZE 0 + #endif diff --git a/vtest/vtest_renderer.c b/vtest/vtest_renderer.c index 8f0262a..e224aae 100644 --- a/vtest/vtest_renderer.c +++ b/vtest/vtest_renderer.c @@ -162,6 +162,19 @@ end: return ret; } +int vtest_ping_protocol_version(void) +{ + uint32_t hdr_buf[VTEST_HDR_SIZE]; + int ret; + + hdr_buf[VTEST_CMD_LEN] = VCMD_PING_PROTOCOL_VERSION_SIZE; + hdr_buf[VTEST_CMD_ID] = VCMD_PING_PROTOCOL_VERSION; + ret = vtest_block_write(renderer.out_fd, hdr_buf, sizeof(hdr_buf)); + if (ret < 0) + return ret; + return 0; +} + void vtest_destroy_renderer(void) { virgl_renderer_context_destroy(ctx_id); diff --git a/vtest/vtest_server.c b/vtest/vtest_server.c index 3c12fa5..c84ce57 100644 --- a/vtest/vtest_server.c +++ b/vtest/vtest_server.c @@ -132,6 +132,9 @@ again: case VCMD_GET_CAPS2: ret = vtest_send_caps2(); break; + case VCMD_PING_PROTOCOL_VERSION: + ret = vtest_ping_protocol_version(); + break; default: break; }