mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-04 11:58:10 +02:00
virgl: fix virgl_bo_transfer_{put, get} box struct copy
Commit3dfe61ed6e("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 <marek.olsak@amd.com> Cc: Dave Airlie <airlied@redhat.com> Fixes:3dfe61ed6e("gallium: decrease the size of pipe_box - 24 -> 16 bytes") Signed-off-by: Rob Herring <robh@kernel.org> Reviewed-by: Marek Olšák <marek.olsak@amd.com>
This commit is contained in:
parent
e19ea928b9
commit
5771ecc90e
1 changed files with 12 additions and 2 deletions
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue