summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/iris/iris_fence.c
diff options
context:
space:
mode:
authorMark Janes <[email protected]>2019-07-25 10:50:36 -0700
committerMark Janes <[email protected]>2019-08-01 16:38:40 -0700
commit7852fe54159cb6602a4408b8107b52999890dc79 (patch)
treea81d986430509aedc6defb1f1cb3b78e2e6fb677 /src/gallium/drivers/iris/iris_fence.c
parentb40ba2db6c81021f83465a4ac32922a064cc91b2 (diff)
intel/common: provide common ioctl routine
i965 links against libdrm for drmIoctl, but anv and iris both re-implement this routine to avoid the dependency. intel/dev also needs an ioctl wrapper, so lets share the same implementation everywhere. Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Lionel Landwerlin <[email protected]>
Diffstat (limited to 'src/gallium/drivers/iris/iris_fence.c')
-rw-r--r--src/gallium/drivers/iris/iris_fence.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/src/gallium/drivers/iris/iris_fence.c b/src/gallium/drivers/iris/iris_fence.c
index 53102dff3a0..d4ce3c16728 100644
--- a/src/gallium/drivers/iris/iris_fence.c
+++ b/src/gallium/drivers/iris/iris_fence.c
@@ -27,6 +27,7 @@
*/
#include "util/u_inlines.h"
+#include "intel/common/gen_gem.h"
#include "iris_batch.h"
#include "iris_bufmgr.h"
@@ -41,7 +42,7 @@ gem_syncobj_create(int fd, uint32_t flags)
.flags = flags,
};
- drm_ioctl(fd, DRM_IOCTL_SYNCOBJ_CREATE, &args);
+ gen_ioctl(fd, DRM_IOCTL_SYNCOBJ_CREATE, &args);
return args.handle;
}
@@ -53,7 +54,7 @@ gem_syncobj_destroy(int fd, uint32_t handle)
.handle = handle,
};
- drm_ioctl(fd, DRM_IOCTL_SYNCOBJ_DESTROY, &args);
+ gen_ioctl(fd, DRM_IOCTL_SYNCOBJ_DESTROY, &args);
}
/**
@@ -152,7 +153,7 @@ iris_wait_syncpt(struct pipe_screen *p_screen,
.count_handles = 1,
.timeout_nsec = timeout_nsec,
};
- return drm_ioctl(screen->fd, DRM_IOCTL_SYNCOBJ_WAIT, &args);
+ return gen_ioctl(screen->fd, DRM_IOCTL_SYNCOBJ_WAIT, &args);
}
static void
@@ -246,7 +247,7 @@ iris_fence_finish(struct pipe_screen *p_screen,
.timeout_nsec = rel2abs(timeout), /* XXX */
.flags = DRM_SYNCOBJ_WAIT_FLAGS_WAIT_ALL
};
- return drm_ioctl(screen->fd, DRM_IOCTL_SYNCOBJ_WAIT, &args) == 0;
+ return gen_ioctl(screen->fd, DRM_IOCTL_SYNCOBJ_WAIT, &args) == 0;
}
#ifndef SYNC_IOC_MAGIC
@@ -282,7 +283,7 @@ sync_merge_fd(int sync_fd, int new_fd)
.fence = -1,
};
- drm_ioctl(sync_fd, SYNC_IOC_MERGE, &args);
+ gen_ioctl(sync_fd, SYNC_IOC_MERGE, &args);
close(new_fd);
close(sync_fd);
@@ -303,7 +304,7 @@ iris_fence_get_fd(struct pipe_screen *p_screen,
.fd = -1,
};
- drm_ioctl(screen->fd, DRM_IOCTL_SYNCOBJ_HANDLE_TO_FD, &args);
+ gen_ioctl(screen->fd, DRM_IOCTL_SYNCOBJ_HANDLE_TO_FD, &args);
fd = sync_merge_fd(fd, args.fd);
}
@@ -323,7 +324,7 @@ iris_fence_create_fd(struct pipe_context *ctx,
.flags = DRM_SYNCOBJ_FD_TO_HANDLE_FLAGS_IMPORT_SYNC_FILE,
.fd = fd,
};
- drm_ioctl(screen->fd, DRM_IOCTL_SYNCOBJ_FD_TO_HANDLE, &args);
+ gen_ioctl(screen->fd, DRM_IOCTL_SYNCOBJ_FD_TO_HANDLE, &args);
struct iris_syncpt *syncpt = malloc(sizeof(*syncpt));
syncpt->handle = args.handle;