summaryrefslogtreecommitdiffstats
path: root/src/gallium
diff options
context:
space:
mode:
authorRob Herring <[email protected]>2017-05-12 17:05:53 -0500
committerEmil Velikov <[email protected]>2017-05-19 23:17:29 +0100
commit832f6b45433aceb75dda28d2d5b5d26ee9d43e70 (patch)
tree9bf8b218cb775093da0885d271d440c9fc5d34d7 /src/gallium
parentb6f92084bd67a9d761285c64b9a6234ee8824a9d (diff)
virgl: fix virgl_bo_transfer_{put, get} box struct copy
Commit 3dfe61ed6ec6 ("gallium: decrease the size of pipe_box - 24 -> 16 bytes") changed the size of pipe_box, but the virgl code was relying on pipe_box and drm_virtgpu_3d_box structs having the same size/layout doing a struct copy. Copy the fields one by one instead. Cc: Marek Olšák <[email protected]> Cc: Dave Airlie <[email protected]> Fixes: 3dfe61ed6ec ("gallium: decrease the size of pipe_box - 24 -> 16 bytes") Signed-off-by: Rob Herring <[email protected]> Reviewed-by: Marek Olšák <[email protected]> (cherry picked from commit 5771ecc90ee7625564c1d3cea1a4fc382b0f58b5)
Diffstat (limited to 'src/gallium')
-rw-r--r--src/gallium/winsys/virgl/drm/virgl_drm_winsys.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/src/gallium/winsys/virgl/drm/virgl_drm_winsys.c b/src/gallium/winsys/virgl/drm/virgl_drm_winsys.c
index 36c75128f46..7f542e7f1ff 100644
--- a/src/gallium/winsys/virgl/drm/virgl_drm_winsys.c
+++ b/src/gallium/winsys/virgl/drm/virgl_drm_winsys.c
@@ -258,7 +258,12 @@ virgl_bo_transfer_put(struct virgl_winsys *vws,
memset(&tohostcmd, 0, sizeof(tohostcmd));
tohostcmd.bo_handle = res->bo_handle;
- tohostcmd.box = *(struct drm_virtgpu_3d_box *)box;
+ tohostcmd.box.x = box->x;
+ tohostcmd.box.y = box->y;
+ tohostcmd.box.z = box->z;
+ tohostcmd.box.w = box->width;
+ tohostcmd.box.h = box->height;
+ tohostcmd.box.d = box->depth;
tohostcmd.offset = buf_offset;
tohostcmd.level = level;
// tohostcmd.stride = stride;
@@ -282,7 +287,12 @@ virgl_bo_transfer_get(struct virgl_winsys *vws,
fromhostcmd.offset = buf_offset;
// fromhostcmd.stride = stride;
// fromhostcmd.layer_stride = layer_stride;
- fromhostcmd.box = *(struct drm_virtgpu_3d_box *)box;
+ fromhostcmd.box.x = box->x;
+ fromhostcmd.box.y = box->y;
+ fromhostcmd.box.z = box->z;
+ fromhostcmd.box.w = box->width;
+ fromhostcmd.box.h = box->height;
+ fromhostcmd.box.d = box->depth;
return drmIoctl(vdws->fd, DRM_IOCTL_VIRTGPU_TRANSFER_FROM_HOST, &fromhostcmd);
}