aboutsummaryrefslogtreecommitdiffstats
path: root/src/freedreno/vulkan/tu_android.c
diff options
context:
space:
mode:
authorEric Engestrom <[email protected]>2020-06-05 10:22:47 +0200
committerMarge Bot <[email protected]>2020-06-18 02:09:56 +0000
commit9ca2a4e6fc9d059a024ba8da20891ccf79ba659d (patch)
tree571a9fa020e30e677ea279b692c0eb77d6c3fd9e /src/freedreno/vulkan/tu_android.c
parentbd5cf70d3db711c31a2f2fca4eb05e20c185e38c (diff)
freedreno: replace all dup() with os_dupfd_cloexec()
Signed-off-by: Eric Engestrom <[email protected]> Reviewed-by: Kristian H. Kristensen <[email protected]> Reviewed-by: Lionel Landwerlin <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5369>
Diffstat (limited to 'src/freedreno/vulkan/tu_android.c')
-rw-r--r--src/freedreno/vulkan/tu_android.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/freedreno/vulkan/tu_android.c b/src/freedreno/vulkan/tu_android.c
index 00a3a577468..d82c8e9125d 100644
--- a/src/freedreno/vulkan/tu_android.c
+++ b/src/freedreno/vulkan/tu_android.c
@@ -33,6 +33,8 @@
#include "drm-uapi/drm_fourcc.h"
+#include "util/os_file.h"
+
static int
tu_hal_open(const struct hw_module_t *mod,
const char *id,
@@ -154,7 +156,7 @@ tu_image_from_gralloc(VkDevice device_h,
.sType = VK_STRUCTURE_TYPE_IMPORT_MEMORY_FD_INFO_KHR,
.pNext = &ded_alloc,
.handleType = VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_FD_BIT,
- .fd = dup(dma_buf),
+ .fd = os_dupfd_cloexec(dma_buf),
};
result =
@@ -293,7 +295,7 @@ tu_AcquireImageANDROID(VkDevice device,
if (semaphore != VK_NULL_HANDLE) {
int semaphore_fd =
- nativeFenceFd >= 0 ? dup(nativeFenceFd) : nativeFenceFd;
+ nativeFenceFd >= 0 ? os_dupfd_cloexec(nativeFenceFd) : nativeFenceFd;
semaphore_result = tu_ImportSemaphoreFdKHR(
device, &(VkImportSemaphoreFdInfoKHR) {
.sType = VK_STRUCTURE_TYPE_IMPORT_SEMAPHORE_FD_INFO_KHR,
@@ -304,7 +306,7 @@ tu_AcquireImageANDROID(VkDevice device,
}
if (fence != VK_NULL_HANDLE) {
- int fence_fd = nativeFenceFd >= 0 ? dup(nativeFenceFd) : nativeFenceFd;
+ int fence_fd = nativeFenceFd >= 0 ? os_dupfd_cloexec(nativeFenceFd) : nativeFenceFd;
fence_result = tu_ImportFenceFdKHR(
device, &(VkImportFenceFdInfoKHR) {
.sType = VK_STRUCTURE_TYPE_IMPORT_FENCE_FD_INFO_KHR,