]> git.baikalelectronics.ru Git - kernel.git/commit
drm/syncobj: add sync obj wait interface. (v8)
authorDave Airlie <airlied@redhat.com>
Fri, 25 Aug 2017 17:52:22 +0000 (10:52 -0700)
committerDave Airlie <airlied@redhat.com>
Mon, 28 Aug 2017 20:26:32 +0000 (06:26 +1000)
commit09d3615d307a44789ead2d831651ead10b1950a0
treee6ab7ff3bbb3f4c314f7a3687e34aebfee2a80f2
parent56a24167106d4f36099304cc0a814014a91056d5
drm/syncobj: add sync obj wait interface. (v8)

This interface will allow sync object to be used to back
Vulkan fences. This API is pretty much the vulkan fence waiting
API, and I've ported the code from amdgpu.

v2: accept relative timeout, pass remaining time back
to userspace.
v3: return to absolute timeouts.
v4: absolute zero = poll,
    rewrite any/all code to have same operation for arrays
    return -EINVAL for 0 fences.
v4.1: fixup fences allocation check, use u64_to_user_ptr
v5: move to sec/nsec, and use timespec64 for calcs.
v6: use -ETIME and drop the out status flag. (-ETIME
is suggested by ickle, I can feel a shed painting)
v7: talked to Daniel/Arnd, use ktime and ns everywhere.
v8: be more careful in the timeout calculations
    use uint32_t for counter variables so we don't overflow
    graciously handle -ENOINT being returned from dma_fence_wait_timeout

Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Acked-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
drivers/gpu/drm/drm_internal.h
drivers/gpu/drm/drm_ioctl.c
drivers/gpu/drm/drm_syncobj.c
include/uapi/drm/drm.h