diff --git a/vtest/vtest_renderer.c b/vtest/vtest_renderer.c index eed4469..493f81e 100644 --- a/vtest/vtest_renderer.c +++ b/vtest/vtest_renderer.c @@ -34,7 +34,9 @@ #include #include "vtest.h" +#include "vtest_shm.h" #include "vtest_protocol.h" + #include "util.h" #include "util/u_debug.h" #include "util/u_math.h" @@ -243,6 +245,12 @@ int vtest_protocol_version(UNUSED uint32_t length_dw) renderer.protocol_version = 0; } + /* Protocol version 2 requires shm support. */ + if (!vtest_shm_check()) { + printf("Shared memory not supported, fallbacking to protocol version 0\n"); + renderer.protocol_version = 0; + } + hdr_buf[VTEST_CMD_LEN] = VCMD_PROTOCOL_VERSION_SIZE; hdr_buf[VTEST_CMD_ID] = VCMD_PROTOCOL_VERSION;