summaryrefslogtreecommitdiffstats
path: root/src/gallium/winsys/virgl/vtest
diff options
context:
space:
mode:
authorGert Wollny <[email protected]>2018-10-04 16:40:07 +0200
committerGert Wollny <[email protected]>2018-10-06 13:12:44 +0200
commit5d7858f1517eb0961811e4106ba11c011d7002e3 (patch)
tree6db7d297dcd454e9c07bb7f047cdc2fd44c323f7 /src/gallium/winsys/virgl/vtest
parent066850edadfe2aa0d339a0c6211ef0a61755a415 (diff)
virgl, vtest: Correct the transfer size calculation
The transfer size used in virglrenderer refers to uint32_t, so one must add 3 and then divide by 4 instead of adding 3/4 which is a no-op with integers. Fixes: b3b82fe8ea virgl/vtest: add vtest driver Signed-off-by: Gert Wollny <[email protected]> Reviewed-by: Gurchetan Singh <[email protected]>
Diffstat (limited to 'src/gallium/winsys/virgl/vtest')
-rw-r--r--src/gallium/winsys/virgl/vtest/virgl_vtest_socket.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/gallium/winsys/virgl/vtest/virgl_vtest_socket.c b/src/gallium/winsys/virgl/vtest/virgl_vtest_socket.c
index 4d20a63ad64..ce565ee76cf 100644
--- a/src/gallium/winsys/virgl/vtest/virgl_vtest_socket.c
+++ b/src/gallium/winsys/virgl/vtest/virgl_vtest_socket.c
@@ -295,8 +295,10 @@ int virgl_vtest_send_transfer_cmd(struct virgl_vtest_winsys *vws,
vtest_hdr[VTEST_CMD_LEN] = VCMD_TRANSFER_HDR_SIZE;
vtest_hdr[VTEST_CMD_ID] = vcmd;
+ /* The host expects the size in dwords so calculate the rounded up
+ * value here. */
if (vcmd == VCMD_TRANSFER_PUT)
- vtest_hdr[VTEST_CMD_LEN] += data_size + 3 / 4;
+ vtest_hdr[VTEST_CMD_LEN] += (data_size + 3) / 4;
cmd[0] = handle;
cmd[1] = level;