virgl: fix stride + layer_stride inconsistency
authorGurchetan Singh <gurchetansingh@chromium.org>
Wed, 2 Oct 2019 01:03:11 +0000 (18:03 -0700)
committerGurchetan Singh <gurchetansingh@chromium.org>
Thu, 1 Oct 2020 23:56:37 +0000 (16:56 -0700)
commit5c2129d4347ddf44e299f014335beeb239360fca
tree114957b965feabc968735c7413505b0d9fc9d411
parent87383e3163d3425cf34d7b9be80a4877ec4a3dfc
virgl: fix stride + layer_stride inconsistency

With blob resources, stride doesn't necesarily have to
equal width * bpp.  The use case for this a minigbm blob
resource with blob mem BLOB_MEM_HOST3D_GUEST imported into
guest Mesa.  In addition, for BLOB_MEM_HOST we can repurpose
the transfer ioctls to also flush caches if need be, so this
seems a good time to fix this issue.

Reviewed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4821>
src/gallium/drivers/virgl/virgl_encode.c
src/gallium/winsys/virgl/drm/virgl_drm_winsys.c
src/gallium/winsys/virgl/drm/virgl_drm_winsys.h