summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/virgl/virgl_protocol.h
diff options
context:
space:
mode:
authorGurchetan Singh <[email protected]>2019-01-23 18:11:41 -0800
committerGert Wollny <[email protected]>2019-02-15 11:19:05 +0100
commit35515985a9b82134c2b2f2f501ec45d29f67ec97 (patch)
treec8e0b69d9cdab88f5ac2e2b1b390a8cd501937c6 /src/gallium/drivers/virgl/virgl_protocol.h
parent503ffe46bb3961996c514b2650390d8263893579 (diff)
virgl: limit command length to 16 bits
Much of our logic is based around the idea the upper 16 bits of a command dword can encode the length of the command. Now that the command buffer >= 2^16 - 1, we should check for this. v2: alignment, and only check VIRGL_ENCODE_MAX_DWORDS Reviewed-by: Gert Wollny <[email protected]>
Diffstat (limited to 'src/gallium/drivers/virgl/virgl_protocol.h')
-rw-r--r--src/gallium/drivers/virgl/virgl_protocol.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/gallium/drivers/virgl/virgl_protocol.h b/src/gallium/drivers/virgl/virgl_protocol.h
index 62b28bd5d00..c55a8cc2057 100644
--- a/src/gallium/drivers/virgl/virgl_protocol.h
+++ b/src/gallium/drivers/virgl/virgl_protocol.h
@@ -105,6 +105,7 @@ enum virgl_context_cmd {
*/
#define VIRGL_CMD0(cmd, obj, len) ((cmd) | ((obj) << 8) | ((len) << 16))
+#define VIRGL_CMD0_MAX_DWORDS (((1ULL << 16) - 1) / 4) * 4
/* hw specification */
#define VIRGL_MAX_COLOR_BUFS 8