Rob Clark
12092d1ac7
vulkan: Don't request Ycbcr conversion for rgb
...
Signed-off-by: Rob Clark <robdclark@chromium.org >
Reviewed-by: Roman Stratiienko <r.stratiienko@gmail.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29090 >
2024-05-14 14:53:45 +00:00
Rob Clark
b9bbeb77c7
vulkan/android: Add helper to probe AHB support
...
GetPhysicalDeviceImageFormatProperties() must that an image {format,
flags, usage} combo is unsupported if gralloc will not be able to
perform the allocation. The practical way to test this is to do a
small test allocation.
Signed-off-by: Rob Clark <robdclark@chromium.org >
Reviewed-by: Roman Stratiienko <r.stratiienko@gmail.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29090 >
2024-05-14 14:53:44 +00:00
Roman Stratiienko
8732a619f1
vulkan/android: Add common vkGetAndroidHardwareBufferPropertiesANDROID
...
Change-Id: I1a7542c6eed7ebf00241bce7fd69840a9007ed27
Signed-off-by: Roman Stratiienko <r.stratiienko@gmail.com >
Tested-by: tarsin <yuanqingxiang233@163.com >
Reviewed-by: Rob Clark <robdclark@chromium.org >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25360 >
2024-05-05 22:02:17 +00:00
Roman Stratiienko
e8f7e7582a
vulkan/android: Add common helpers for the AHB extension
...
Change-Id: I0d88ebf6b14b6425a7ecbdbb1c17df62e4ca103a
Signed-off-by: Roman Stratiienko <r.stratiienko@gmail.com >
Tested-by: tarsin <yuanqingxiang233@163.com >
Reviewed-by: Rob Clark <robdclark@chromium.org >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25360 >
2024-05-05 22:02:17 +00:00
Roman Stratiienko
d0996d1a30
vulkan/android: Add common helpers for the ANB extension
...
Change-Id: I999121edfc7163cecc83897eb7be73896de36d89
Signed-off-by: Roman Stratiienko <r.stratiienko@gmail.com >
Tested-by: tarsin <yuanqingxiang233@163.com >
Acked-by: David Heidelberg <david.heidelberg@collabora.com >
Reviewed-by: Rob Clark <robdclark@chromium.org >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25360 >
2024-05-05 22:02:17 +00:00
Roman Stratiienko
c406d53858
vulkan/android: Add common vkGetSwapchainGrallocUsage{2}ANDROID
...
Change-Id: I6db52b8950a075cfbcd8f4a3b66fd13b032d9a5e
Signed-off-by: Roman Stratiienko <r.stratiienko@gmail.com >
Tested-by: tarsin <yuanqingxiang233@163.com >
Acked-by: David Heidelberg <david.heidelberg@collabora.com >
Reviewed-by: Rob Clark <robdclark@chromium.org >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25360 >
2024-05-05 22:02:17 +00:00
Roman Stratiienko
dd9a426e3e
vulkan/android: Add basic u_gralloc support
...
We want to move more Android-related functions into common code.
Many of which require interactions with the gralloc. Therefore,
struct u_gralloc must be kept in a common code.
vk_android_get_ugralloc() must be used for gralloc API calls.
vk_android_{init|destroy}_ugralloc() must be used in Vulkan HAL
initialization code, e.g.:
- In XXXX_hal_open() to initialize the gralloc
- In XXXX_hal_close() to destroy the gralloc
We do not put gralloc initialization into the generic code because we want
it to be initialized by Zygote's Vulkan preloader, which may sometimes
preload gralloc shared libraries, thus speeding up the initialization
of user applications.
Change-Id: I2af643bd132e6cdbfed043c8c18836501764952f
Signed-off-by: Roman Stratiienko <r.stratiienko@gmail.com >
Tested-by: tarsin <yuanqingxiang233@163.com >
Acked-by: David Heidelberg <david.heidelberg@collabora.com >
Reviewed-by: Rob Clark <robdclark@chromium.org >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25360 >
2024-05-05 22:02:17 +00:00
Yiwei Zhang
e8a61a8a6b
vulkan/android: drop vk_buffer dependency from common AHB impl
...
Unlike AHB image, the spec has ensured no special treatment for
allocationSize for AHB buffer export operation.
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/25263 >
2023-09-18 19:25:59 +00:00
Yiwei Zhang
cd0b86fce1
vulkan/android: add missing AHARDWAREBUFFER_USAGE_GPU_DATA_BUFFER usage
...
An AHB backing a Vkbuffer requires AHARDWAREBUFFER_USAGE_GPU_DATA_BUFFER
usage bit, which is missed from the original ANV and RADV Android
frontends as well as the common VK Android refactor.
Cc: mesa-stable
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/25263 >
2023-09-18 19:25:59 +00:00
Ryan Neph
7a5948b3ee
vulkan/android: add missed STACK_ARRAY_FINISH()
...
Fixes: 3c4c263dc7
("vulkan/android: improve vkQueueSignalReleaseImageANDROID")
Signed-off-by: Ryan Neph <ryanneph@google.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25277 >
2023-09-18 11:30:02 -07:00
Yiwei Zhang
3c4c263dc7
vulkan/android: improve vkQueueSignalReleaseImageANDROID
...
There're two issues with the current implementation:
1. Wait semaphores are implicitly required to be SYNC_FD exportable
2. As a queue command that can further record cmds against the wsi
image, it currently doesn't account for pending cmds in the queue
beyond the wait semaphores.
This change fixes both by doing a queue submission in the call with a
SYNC_FD external signal semaphore. However, due to Android wsi not
exposing swapchain to icd, we have to cache the signal semaphore in the
queue, otherwise would have to create/destroy in each present.
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/25185 >
2023-09-15 19:03:22 +00:00
Yiwei Zhang
6ed2515df1
vulkan: remove a dup entry from vk_image_usage_to_ahb_usage
...
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/25185 >
2023-09-15 19:03:22 +00:00
Chia-I Wu
47b37651f8
vulkan: add vk_image_format_to_ahb_format
...
There should be no functional change.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22619 >
2023-05-11 22:18:03 +00:00
Chia-I Wu
380180516c
anv,hasvk,radv: do not fall back to AHARDWAREBUFFER_FORMAT_BLOB
...
When allocating a VkDeviceMemory exportable as AHB, it seems incorrect
to fall back to AHARDWAREBUFFER_FORMAT_BLOB when the image has no known
AHB format. We should fail the allocation instead.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22619 >
2023-05-11 22:18:03 +00:00
Chia-I Wu
50e703f347
vulkan: add vk_ahb_format_to_image_format
...
There should be no functional change.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22619 >
2023-05-11 22:18:02 +00:00
Chia-I Wu
f81dce9bcc
vulkan: rename vk_image::ahardware_buffer_format
...
Rename it to ahb_format.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22619 >
2023-05-11 22:18:02 +00:00
Faith Ekstrand
b16cfe23ef
vulkan,anv,hasvk,radv: Unify Android hardware buffer creation
...
Reviewed-by: Lina Versace <lina@kiwitree.net >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22038 >
2023-03-31 14:57:03 +00:00
Faith Ekstrand
dc0749adab
vulkan/android: Fix hardware buffer usage flags
...
We now add the correct usage flags for input attachments, storage
images, and depth/stencil attachments.
Reviewed-by: Lina Versace <lina@kiwitree.net >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22038 >
2023-03-31 14:57:03 +00:00
Faith Ekstrand
41f88be282
vulkan,anv,hasvk,radv: Add a common vk_image_usage_to_ahb_usage helper
...
Reviewed-by: Lina Versace <lina@kiwitree.net >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22038 >
2023-03-31 14:57:03 +00:00
Faith Ekstrand
9d1c1379e7
vulkan: vk_android.c should be copyright Intel
...
That's where I copied+pasted it from.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22120 >
2023-03-26 00:16:26 +00:00
Jason Ekstrand
b2073f5e5d
radv: Move QueueSignalReleaseImageANDROID to common code
...
This is mostly a copy+paste job but with a few syntax changes to make it
follow more closely with other common Vulkan code.
Reviewed-by: Eric Engestrom <eric@engestrom.ch >
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14372 >
2022-01-05 16:36:10 +00:00
Jason Ekstrand
dfb1e1777c
anv,radv,v3dv: Move AcquireImageANDROID to common code
...
All three implementations are identical.
Reviewed-by: Eric Engestrom <eric@engestrom.ch >
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com >
Tested-by: Tapani Pälli <tapani.palli@intel.com >
Tested-by: Roman Stratiienko <r.stratiienko@gmail.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14372 >
2022-01-05 16:36:10 +00:00