Mesa (main): turnip: Use vk_common_QueueSignalReleaseImageANDROID for DRM
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Tue Jan 11 18:00:50 UTC 2022
Module: Mesa
Branch: main
Commit: c8d364cb9d33d70205c363176a10564d21a29880
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=c8d364cb9d33d70205c363176a10564d21a29880
Author: Jason Ekstrand <jason at jlekstrand.net>
Date: Sat Jan 1 23:12:43 2022 -0600
turnip: Use vk_common_QueueSignalReleaseImageANDROID for DRM
It's identical to the one turnip copy+pasted from RADV. For KGSL, we
still need to hand-roll because of all the emulated stuff.
Reviewed-by: Eric Engestrom <eric at engestrom.ch>
Reviewed-by: Iago Toral Quiroga <itoral at igalia.com>
Reviewed-by: Hyunjun Ko <zzoon at igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14411>
---
src/freedreno/vulkan/tu_drm.c | 56 -------------------------------------------
1 file changed, 56 deletions(-)
diff --git a/src/freedreno/vulkan/tu_drm.c b/src/freedreno/vulkan/tu_drm.c
index 591115e738e..624112fff01 100644
--- a/src/freedreno/vulkan/tu_drm.c
+++ b/src/freedreno/vulkan/tu_drm.c
@@ -1843,59 +1843,3 @@ tu_SignalSemaphore(VkDevice _device,
return result;
}
-
-#ifdef ANDROID
-#include <libsync.h>
-
-VKAPI_ATTR VkResult VKAPI_CALL
-tu_QueueSignalReleaseImageANDROID(VkQueue _queue,
- uint32_t waitSemaphoreCount,
- const VkSemaphore *pWaitSemaphores,
- VkImage image,
- int *pNativeFenceFd)
-{
- TU_FROM_HANDLE(tu_queue, queue, _queue);
- VkResult result = VK_SUCCESS;
-
- if (waitSemaphoreCount == 0) {
- if (pNativeFenceFd)
- *pNativeFenceFd = -1;
- return VK_SUCCESS;
- }
-
- int fd = -1;
-
- for (uint32_t i = 0; i < waitSemaphoreCount; ++i) {
- int tmp_fd;
- result = tu_GetSemaphoreFdKHR(
- tu_device_to_handle(queue->device),
- &(VkSemaphoreGetFdInfoKHR) {
- .sType = VK_STRUCTURE_TYPE_SEMAPHORE_GET_FD_INFO_KHR,
- .handleType = VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_SYNC_FD_BIT,
- .semaphore = pWaitSemaphores[i],
- },
- &tmp_fd);
- if (result != VK_SUCCESS) {
- if (fd >= 0)
- close(fd);
- return result;
- }
-
- if (fd < 0)
- fd = tmp_fd;
- else if (tmp_fd >= 0) {
- sync_accumulate("tu", &fd, tmp_fd);
- close(tmp_fd);
- }
- }
-
- if (pNativeFenceFd) {
- *pNativeFenceFd = fd;
- } else if (fd >= 0) {
- close(fd);
- /* We still need to do the exports, to reset the semaphores, but
- * otherwise we don't wait on them. */
- }
- return VK_SUCCESS;
-}
-#endif
More information about the mesa-commit
mailing list