summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAndres Rodriguez <[email protected]>2017-12-15 00:13:50 -0500
committerAndres Rodriguez <[email protected]>2018-01-30 15:13:49 -0500
commit5b07b06d6bb1d01d1aec49d6ba458fc6c789fbc9 (patch)
tree27d52c63a544a2d4c316917d558b91e231fd60ca /src
parentcc9762d74d33898f56cfcbd9ab386364a19df6dc (diff)
radeonsi: add support for importing PIPE_FD_TYPE_SYNCOBJ semaphores
Hook up importing semaphores of type PIPE_FD_TYPE_SYNCOBJ Signed-off-by: Andres Rodriguez <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
Diffstat (limited to 'src')
-rw-r--r--src/gallium/drivers/radeonsi/si_fence.c26
1 files changed, 20 insertions, 6 deletions
diff --git a/src/gallium/drivers/radeonsi/si_fence.c b/src/gallium/drivers/radeonsi/si_fence.c
index d3a68e50e1c..ef80b38aa67 100644
--- a/src/gallium/drivers/radeonsi/si_fence.c
+++ b/src/gallium/drivers/radeonsi/si_fence.c
@@ -305,18 +305,32 @@ static void si_create_fence_fd(struct pipe_context *ctx,
struct radeon_winsys *ws = sscreen->ws;
struct si_multi_fence *rfence;
- assert(type == PIPE_FD_TYPE_NATIVE_SYNC);
-
*pfence = NULL;
- if (!sscreen->info.has_fence_to_handle)
- return;
-
rfence = si_create_multi_fence();
if (!rfence)
return;
- rfence->gfx = ws->fence_import_sync_file(ws, fd);
+ switch (type) {
+ case PIPE_FD_TYPE_NATIVE_SYNC:
+ if (!sscreen->info.has_fence_to_handle)
+ goto finish;
+
+ rfence->gfx = ws->fence_import_sync_file(ws, fd);
+ break;
+
+ case PIPE_FD_TYPE_SYNCOBJ:
+ if (!sscreen->info.has_syncobj)
+ goto finish;
+
+ rfence->gfx = ws->fence_import_syncobj(ws, fd);
+ break;
+
+ default:
+ unreachable("bad fence fd type when importing");
+ }
+
+finish:
if (!rfence->gfx) {
FREE(rfence);
return;