radv: When importing an image, redo the layout based on the metadata.
authorBas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Mon, 4 May 2020 15:04:00 +0000 (17:04 +0200)
committerMarge Bot <eric+marge@anholt.net>
Fri, 14 Aug 2020 10:29:44 +0000 (10:29 +0000)
commitd19bc94e4eb94a2c8cbdb328c9eaa2faf1ba424c
tree9b187c7b33b393821ef0405d105dc849ffcefb1d
parenta0d67b7a1c32f4fcfdc8c6a66bc3359b1003c752
radv: When importing an image, redo the layout based on the metadata.

When importing a DMA-BUF, the image layout created in vkImageCreate may
not match the imported BO's. To make this work we redo the layout based
on the metadata of the imported image.

The original patch did a delayed allocation just as for AHB, but that
does not work for images that are not imported (but e.g. exported only).

Original patch by Simon Ser <contact@emersion.fr>

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/2801
CC: mesa-stable
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6274>
src/amd/vulkan/radv_device.c
src/amd/vulkan/radv_image.c