drm/xe: Use nanoseconds instead of jiffies in uapi for user fence
authorZbigniew Kempczyński <zbigniew.kempczynski@intel.com>
Wed, 28 Jun 2023 05:51:41 +0000 (07:51 +0200)
committerRodrigo Vivi <rodrigo.vivi@intel.com>
Thu, 21 Dec 2023 16:35:06 +0000 (11:35 -0500)
commit5572a004685770f8daad7661c5494b65148ede9f
tree6e8bb734e0a9a686c3db3d8baca3c092410af292
parent2e60442a4fef935c76cd70858775b92f565642cc
drm/xe: Use nanoseconds instead of jiffies in uapi for user fence

Using jiffies as a timeout from userspace is weird even if
theoretically exists possiblity of acquiring jiffies via getconf.
Unfortunately this method is unreliable and the returned
value may vary from the one configured in the kernel config.

Now timeout is expressed in nanoseconds and its interpretation depends
on setting DRM_XE_UFENCE_WAIT_ABSTIME flag. Relative timeout (flag
is not set) means fence expire at now() + timeout. Absolute timeout
(flag is set) means that the fence expires at exact point of time.
Passing negative timeout means we will wait "forever" by setting
wait time to MAX_SCHEDULE_TIMEOUT.

Cc: Andi Shyti <andi.shyti@linux.intel.com>
Reviewed-by: Andi Shyti <andi.shyti@linux.intel.com>
Link: https://lore.kernel.org/r/20230628055141.398036-2-zbigniew.kempczynski@intel.com
Signed-off-by: Zbigniew Kempczyński <zbigniew.kempczynski@intel.com>
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
drivers/gpu/drm/xe/xe_wait_user_fence.c
include/uapi/drm/xe_drm.h