virgl: without shm, fallback to protocol version -1

Signed-off-by: Gurchetan Singh <gurchetansingh@chromium.org>
Reviewed-By: Gert Wollny <gert.wollny@collabora.com>
macos/master
Gurchetan Singh 6 years ago
parent c3b0a155ff
commit 34e7def844
  1. 8
      vtest/vtest_renderer.c

@ -34,7 +34,9 @@
#include <sys/uio.h> #include <sys/uio.h>
#include "vtest.h" #include "vtest.h"
#include "vtest_shm.h"
#include "vtest_protocol.h" #include "vtest_protocol.h"
#include "util.h" #include "util.h"
#include "util/u_debug.h" #include "util/u_debug.h"
#include "util/u_math.h" #include "util/u_math.h"
@ -243,6 +245,12 @@ int vtest_protocol_version(UNUSED uint32_t length_dw)
renderer.protocol_version = 0; 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_LEN] = VCMD_PROTOCOL_VERSION_SIZE;
hdr_buf[VTEST_CMD_ID] = VCMD_PROTOCOL_VERSION; hdr_buf[VTEST_CMD_ID] = VCMD_PROTOCOL_VERSION;

Loading…
Cancel
Save