summaryrefslogtreecommitdiffstats
path: root/src/gallium
diff options
context:
space:
mode:
authorChris Wilson <[email protected]>2020-02-22 15:51:15 +0000
committerMarge Bot <[email protected]>2020-02-24 15:43:19 +0000
commitae7bda27a0691d6d89c35c9f732b6e49d726c17f (patch)
treea09d6c2ae58f5ef743250b07e922f98e583be714 /src/gallium
parent3a310fbd0b2bb5730fda57643a3e05870e70d248 (diff)
iris: Fix import sync-file into syncobj
When importing a sync-file, the kernel expects to be told which syncobj to replace with the new fence -- it does not automatically create a new handle for us. Abide by this rule and create a new syncobj for the imported sync-file. Fixes: f459c56be6bf ("iris: Add fence support using drm_syncobj") Cc: Lionel Landwerlin <[email protected]> Reviewed-by: Lionel Landwerlin <[email protected]> Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3919> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3919>
Diffstat (limited to 'src/gallium')
-rw-r--r--src/gallium/drivers/iris/iris_fence.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/gallium/drivers/iris/iris_fence.c b/src/gallium/drivers/iris/iris_fence.c
index d8c3bd932ce..0d3144d61cc 100644
--- a/src/gallium/drivers/iris/iris_fence.c
+++ b/src/gallium/drivers/iris/iris_fence.c
@@ -356,12 +356,14 @@ iris_fence_create_fd(struct pipe_context *ctx,
struct iris_screen *screen = (struct iris_screen *)ctx->screen;
struct drm_syncobj_handle args = {
+ .handle = gem_syncobj_create(screen->fd, DRM_SYNCOBJ_CREATE_SIGNALED),
.flags = DRM_SYNCOBJ_FD_TO_HANDLE_FLAGS_IMPORT_SYNC_FILE,
.fd = fd,
};
if (gen_ioctl(screen->fd, DRM_IOCTL_SYNCOBJ_FD_TO_HANDLE, &args) == -1) {
fprintf(stderr, "DRM_IOCTL_SYNCOBJ_FD_TO_HANDLE failed: %s\n",
strerror(errno));
+ gem_syncobj_destroy(screen->fd, args.handle);
*out = NULL;
return;
}