[igt-dev] [PATCH i-g-t 2/3] xe/xe_ioctl: Return remaining timeout of user fence wait

Kumar, Janga Rahul janga.rahul.kumar at intel.com
Thu Jun 1 11:31:28 UTC 2023


LGTM
Reviewed-by: Janga Rahul Kumar <janga.rahul.kumar at intel.com>

> -----Original Message-----
> From: igt-dev <igt-dev-bounces at lists.freedesktop.org> On Behalf Of
> Zbigniew Kempczynski
> Sent: 01 June 2023 01:01
> To: igt-dev at lists.freedesktop.org
> Subject: [igt-dev] [PATCH i-g-t 2/3] xe/xe_ioctl: Return remaining timeout of
> user fence wait
> 
> 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>
> ---
>  lib/xe/xe_ioctl.c | 4 +++-
>  lib/xe/xe_ioctl.h | 2 +-
>  2 files changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/lib/xe/xe_ioctl.c b/lib/xe/xe_ioctl.c index fe61b70a83..82340c6a97
> 100644
> --- a/lib/xe/xe_ioctl.c
> +++ b/lib/xe/xe_ioctl.c
> @@ -400,7 +400,7 @@ 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,
> +long xe_wait_ufence(int fd, uint64_t *addr, uint64_t value,
>  		    struct drm_xe_engine_class_instance *eci,
>  		    int64_t timeout)
>  {
> @@ -416,6 +416,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;
>  }
> 
>  long xe_wait_ufence_abstime(int fd, uint64_t *addr, uint64_t value, diff --
> git a/lib/xe/xe_ioctl.h b/lib/xe/xe_ioctl.h index 9b44892fe9..860de9af58
> 100644
> --- a/lib/xe/xe_ioctl.h
> +++ b/lib/xe/xe_ioctl.h
> @@ -79,7 +79,7 @@ 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,
> +long 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,
> --
> 2.34.1



More information about the igt-dev mailing list