Mesa (staging/20.0): iris: Fix import sync-file into syncobj
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Mon Feb 24 19:19:41 UTC 2020
Module: Mesa
Branch: staging/20.0
Commit: 5d48c2965804c3fe82d7955499ab86f53b635d35
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=5d48c2965804c3fe82d7955499ab86f53b635d35
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date: Sat Feb 22 15:51:15 2020 +0000
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 <lionel.g.landwerlin at intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin at intel.com>
Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3919>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3919>
(cherry picked from commit ae7bda27a0691d6d89c35c9f732b6e49d726c17f)
---
.pick_status.json | 2 +-
src/gallium/drivers/iris/iris_fence.c | 2 ++
2 files changed, 3 insertions(+), 1 deletion(-)
diff --git a/.pick_status.json b/.pick_status.json
index 15ce5a1cd9b..b4fbe2b1ffc 100644
--- a/.pick_status.json
+++ b/.pick_status.json
@@ -229,7 +229,7 @@
"description": "iris: Fix import sync-file into syncobj",
"nominated": true,
"nomination_type": 1,
- "resolution": 0,
+ "resolution": 1,
"master_sha": null,
"because_sha": "f459c56be6bf33439cccc11e932b2b5b52ba7ad8"
},
diff --git a/src/gallium/drivers/iris/iris_fence.c b/src/gallium/drivers/iris/iris_fence.c
index dbd2d826588..288c43fb276 100644
--- a/src/gallium/drivers/iris/iris_fence.c
+++ b/src/gallium/drivers/iris/iris_fence.c
@@ -340,12 +340,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;
}
More information about the mesa-commit
mailing list