[igt-dev] [PATCH i-g-t 1/3] xe/xe_ioctl: Add xe_wait_ufence_abstime() helper
Kamil Konieczny
kamil.konieczny at linux.intel.com
Thu Jun 1 17:32:57 UTC 2023
Hi Zbigniew,
On 2023-05-31 at 21:30:41 +0200, Zbigniew Kempczyński wrote:
> Xe user fences supports passing timeout in relative or absolute form.
> Add helper for absolute one.
Please add lib/ in Subject, for example:
lib/xe_ioctl: Add xe_wait_ufence_abstime() helper
>
> Signed-off-by: Zbigniew Kempczyński <zbigniew.kempczynski at intel.com>
> Cc: Kamil Konieczny <kamil.konieczny at linux.intel.com>
> ---
> lib/xe/xe_ioctl.c | 20 ++++++++++++++++++++
> lib/xe/xe_ioctl.h | 3 +++
> 2 files changed, 23 insertions(+)
>
> diff --git a/lib/xe/xe_ioctl.c b/lib/xe/xe_ioctl.c
> index 66a8393fe9..fe61b70a83 100644
> --- a/lib/xe/xe_ioctl.c
> +++ b/lib/xe/xe_ioctl.c
> @@ -418,6 +418,26 @@ void xe_wait_ufence(int fd, uint64_t *addr, uint64_t value,
> igt_assert_eq(igt_ioctl(fd, DRM_IOCTL_XE_WAIT_USER_FENCE, &wait), 0);
> }
>
Please write documentation for this new public function.
Regards,
Kamil
> +long xe_wait_ufence_abstime(int fd, uint64_t *addr, uint64_t value,
> + struct drm_xe_engine_class_instance *eci,
> + int64_t timeout)
> +{
> + struct drm_xe_wait_user_fence wait = {
> + .addr = to_user_pointer(addr),
> + .op = DRM_XE_UFENCE_WAIT_EQ,
> + .flags = !eci ? DRM_XE_UFENCE_WAIT_SOFT_OP | DRM_XE_UFENCE_WAIT_ABSTIME : 0,
> + .value = value,
> + .mask = DRM_XE_UFENCE_WAIT_U64,
> + .timeout = timeout,
> + .num_engines = eci ? 1 : 0,
> + .instances = eci ? to_user_pointer(eci) : 0,
> + };
> +
> + igt_assert_eq(igt_ioctl(fd, DRM_IOCTL_XE_WAIT_USER_FENCE, &wait), 0);
> +
> + return wait.timeout;
> +}
> +
> void xe_force_gt_reset(int fd, int gt)
> {
> char reset_string[128];
> diff --git a/lib/xe/xe_ioctl.h b/lib/xe/xe_ioctl.h
> index 049cd183d6..9b44892fe9 100644
> --- a/lib/xe/xe_ioctl.h
> +++ b/lib/xe/xe_ioctl.h
> @@ -82,6 +82,9 @@ void xe_exec_wait(int fd, uint32_t engine, uint64_t addr);
> void xe_wait_ufence(int fd, uint64_t *addr, uint64_t value,
> struct drm_xe_engine_class_instance *eci,
> int64_t timeout);
> +long xe_wait_ufence_abstime(int fd, uint64_t *addr, uint64_t value,
> + struct drm_xe_engine_class_instance *eci,
> + int64_t timeout);
> void xe_force_gt_reset(int fd, int gt);
> void xe_vm_madvise(int fd, uint32_t vm, uint64_t addr, uint64_t size,
> uint32_t property, uint32_t value);
> --
> 2.34.1
>
More information about the igt-dev
mailing list