venus: fix misaligned bo_flags between import and query
authorYiwei Zhang <zzyiwei@chromium.org>
Thu, 27 May 2021 21:56:08 +0000 (21:56 +0000)
committerMarge Bot <eric+marge@anholt.net>
Sat, 29 May 2021 04:48:50 +0000 (04:48 +0000)
commitccefcb0baf995c05ed201a6059a259abf4b321a6
treebdf75e73434f877b21ba81092b770e88a98b0162
parent1df4c960c67bec760ac1872d601f239fcad2b7d1
venus: fix misaligned bo_flags between import and query

For importing an dma_buf fd, export info is not required. Leaving the
bo_flags missing VIRTGPU_BLOB_FLAG_USE_SHAREABLE bit as well as the
VIRTGPU_BLOB_FLAG_USE_CROSS_DEVICE bit. Upon querying fd properties,
DMA_BUF handle type will be specified which generates a new bo_flags
not matching the prior one.

This patch aligns the above 2 bits for the dma_buf import path.

Test: vkGetAndroidHardwareBufferPropertiesANDROID should succeed with
      a valid AHB with AHARDWAREBUFFER_FORMAT_BLOB format.

Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Reviewed-by: Chia-I Wu <olvaffe@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11055>
src/virtio/vulkan/vn_device_memory.c
src/virtio/vulkan/vn_renderer.h
src/virtio/vulkan/vn_renderer_virtgpu.c