radv: relax the native_handle_t::numFds requirement

For modern gralloc impl, usually there's other fds appended in the
native_handle_t for gralloc buffer metadata sharing. So numFds can be
greater than 1, while the common agreement is still that the format
plane handles being placed at the beginning in the lack of a standard
format plane fd metadata query mapper api.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/13163

Cc: mesa-stable
Acked-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35038>
This commit is contained in:
Yiwei Zhang 2025-05-17 11:57:31 -07:00 committed by Marge Bot
parent b0f8c22682
commit 41d241bf6e

View file

@ -51,10 +51,10 @@ radv_image_from_gralloc(VkDevice device_h, const VkImageCreateInfo *base_info,
struct radv_image *image = NULL;
VkResult result;
if (gralloc_info->handle->numFds != 1) {
if (gralloc_info->handle->numFds < 1) {
return vk_errorf(device, VK_ERROR_INVALID_EXTERNAL_HANDLE,
"VkNativeBufferANDROID::handle::numFds is %d, "
"expected 1",
"expected >= 1",
gralloc_info->handle->numFds);
}