Просмотр исходного кода

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 <gert.wollny@collabora.com>
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
(cherry picked from commit 5d7858f151)
tags/mesa-18.2.3
Gert Wollny 7 лет назад
Родитель
Сommit
4136c4e066
1 измененных файлов: 3 добавлений и 1 удалений
  1. 3
    1
      src/gallium/winsys/virgl/vtest/virgl_vtest_socket.c

+ 3
- 1
src/gallium/winsys/virgl/vtest/virgl_vtest_socket.c Просмотреть файл

@@ -243,8 +243,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;

Загрузка…
Отмена
Сохранить