summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoonbum Ko <joonbum.ko@samsung.com>2020-03-24 12:30:24 +0900
committerJoonbum Ko <joonbum.ko@samsung.com>2020-03-30 14:55:44 +0900
commitabdad7d55b7b84d56b7daf296bf99f6db4fe51b7 (patch)
treec1dc6ee326b56909fc313f02f1ff0cdaef19d510
parent1f0e94faab85518f244f0809c9f7e4ed85dd0fe0 (diff)
downloadmesa-abdad7d55b7b84d56b7daf296bf99f6db4fe51b7.tar.gz
mesa-abdad7d55b7b84d56b7daf296bf99f6db4fe51b7.tar.bz2
mesa-abdad7d55b7b84d56b7daf296bf99f6db4fe51b7.zip
v3d_fence: Added function to get fence_fd from dri2.
Change-Id: Ibd86254f2352a01cd993c61b0ab036c721005be0 Signed-off-by: Joonbum Ko <joonbum.ko@samsung.com>
-rw-r--r--src/gallium/drivers/v3d/v3d_fence.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/gallium/drivers/v3d/v3d_fence.c b/src/gallium/drivers/v3d/v3d_fence.c
index 8d13a09a9f4..a3a18c03b80 100644
--- a/src/gallium/drivers/v3d/v3d_fence.c
+++ b/src/gallium/drivers/v3d/v3d_fence.c
@@ -34,6 +34,8 @@
* fired off as our fence marker.
*/
+#include <fcntl.h>
+
#include "util/u_inlines.h"
#include "util/os_time.h"
@@ -120,9 +122,18 @@ v3d_fence_create(struct v3d_context *v3d)
return f;
}
+static int
+v3d_fence_get_fd(struct pipe_screen *screen, struct pipe_fence_handle *pfence)
+{
+ struct v3d_fence *fence = (struct v3d_fence *)pfence;
+
+ return fcntl(fence->fd, F_DUPFD_CLOEXEC, 3);
+}
+
void
v3d_fence_init(struct v3d_screen *screen)
{
screen->base.fence_reference = v3d_fence_reference;
screen->base.fence_finish = v3d_fence_finish;
+ screen->base.fence_get_fd = v3d_fence_get_fd;
}