[igt-dev] [PATCH i-g-t v3 2/4] lib/xe_ioctl: Return remaining timeout of user fence wait
Kamil Konieczny
kamil.konieczny at linux.intel.com
Mon Jun 19 11:51:02 UTC 2023
Hi Zbigniew,
On 2023-06-19 at 07:32:48 +0200, Zbigniew Kempczyński wrote:
> When user fence is signalled we may want to be aware how long did it
> take. Return remaining timeout after fence was successfully signalled.
>
> Signed-off-by: Zbigniew Kempczyński <zbigniew.kempczynski at intel.com>
> Cc: Kamil Konieczny <kamil.konieczny at linux.intel.com>
>
> ---
> v3: Replace long to int64_t as return value (Kamil)
> ---
> lib/xe/xe_ioctl.c | 8 +++++---
> lib/xe/xe_ioctl.h | 6 +++---
> 2 files changed, 8 insertions(+), 6 deletions(-)
>
> diff --git a/lib/xe/xe_ioctl.c b/lib/xe/xe_ioctl.c
> index c8af747cf7..9ead7307c4 100644
> --- a/lib/xe/xe_ioctl.c
> +++ b/lib/xe/xe_ioctl.c
> @@ -401,9 +401,9 @@ void xe_exec_wait(int fd, uint32_t engine, uint64_t addr)
> syncobj_destroy(fd, sync.handle);
> }
>
> -void xe_wait_ufence(int fd, uint64_t *addr, uint64_t value,
> - struct drm_xe_engine_class_instance *eci,
> - int64_t timeout)
> +int64_t xe_wait_ufence(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),
> @@ -417,6 +417,8 @@ 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);
> +
> + return wait.timeout;
> }
>
> /**
> diff --git a/lib/xe/xe_ioctl.h b/lib/xe/xe_ioctl.h
> index d9d78f86c9..e014ad66c9 100644
> --- a/lib/xe/xe_ioctl.h
> +++ b/lib/xe/xe_ioctl.h
> @@ -79,9 +79,9 @@ void xe_exec(int fd, struct drm_xe_exec *exec);
> void xe_exec_sync(int fd, uint32_t engine, uint64_t addr,
> struct drm_xe_sync *sync, uint32_t num_syncs);
> 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);
> +int64_t xe_wait_ufence(int fd, uint64_t *addr, uint64_t value,
> + struct drm_xe_engine_class_instance *eci,
> + int64_t timeout);
Lgtm,
Reviewed-by: Kamil Konieczny <kamil.konieczny at linux.intel.com>
> int64_t xe_wait_ufence_abstime(int fd, uint64_t *addr, uint64_t value,
> struct drm_xe_engine_class_instance *eci,
> int64_t timeout);
> --
> 2.34.1
>
More information about the igt-dev
mailing list