freedreno: use fd_pipe_wait_timeout()
To properly support the case of waiting on a fence with a 0 timeout, we still need to call down to the kernel. Which requires the use of the new fd_pipe_wait_timeout() API. Signed-off-by: Rob Clark <robclark@freedesktop.org>
This commit is contained in:
parent
fd7a14f8dd
commit
4a0bea3863
|
@ -74,7 +74,7 @@ LIBDRM_AMDGPU_REQUIRED=2.4.63
|
||||||
LIBDRM_INTEL_REQUIRED=2.4.61
|
LIBDRM_INTEL_REQUIRED=2.4.61
|
||||||
LIBDRM_NVVIEUX_REQUIRED=2.4.33
|
LIBDRM_NVVIEUX_REQUIRED=2.4.33
|
||||||
LIBDRM_NOUVEAU_REQUIRED=2.4.62
|
LIBDRM_NOUVEAU_REQUIRED=2.4.62
|
||||||
LIBDRM_FREEDRENO_REQUIRED=2.4.57
|
LIBDRM_FREEDRENO_REQUIRED=2.4.64
|
||||||
DRI2PROTO_REQUIRED=2.6
|
DRI2PROTO_REQUIRED=2.6
|
||||||
DRI3PROTO_REQUIRED=1.0
|
DRI3PROTO_REQUIRED=1.0
|
||||||
PRESENTPROTO_REQUIRED=1.0
|
PRESENTPROTO_REQUIRED=1.0
|
||||||
|
|
|
@ -50,29 +50,11 @@ fd_screen_fence_ref(struct pipe_screen *pscreen,
|
||||||
*ptr = pfence;
|
*ptr = pfence;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* TODO we need to spiff out libdrm_freedreno a bit to allow passing
|
|
||||||
* the timeout.. and maybe a better way to check if fence has been
|
|
||||||
* signaled. The current implementation is a bit lame for now to
|
|
||||||
* avoid bumping libdrm version requirement.
|
|
||||||
*/
|
|
||||||
|
|
||||||
boolean fd_screen_fence_signalled(struct pipe_screen *screen,
|
|
||||||
struct pipe_fence_handle *fence)
|
|
||||||
{
|
|
||||||
uint32_t timestamp = fd_ringbuffer_timestamp(fence->ctx->ring);
|
|
||||||
|
|
||||||
/* TODO util helper for compare w/ rollover? */
|
|
||||||
return timestamp >= fence->timestamp;
|
|
||||||
}
|
|
||||||
|
|
||||||
boolean fd_screen_fence_finish(struct pipe_screen *screen,
|
boolean fd_screen_fence_finish(struct pipe_screen *screen,
|
||||||
struct pipe_fence_handle *fence,
|
struct pipe_fence_handle *fence,
|
||||||
uint64_t timeout)
|
uint64_t timeout)
|
||||||
{
|
{
|
||||||
if (!timeout)
|
if (fd_pipe_wait_timeout(fence->screen->pipe, fence->timestamp, timeout))
|
||||||
return fd_screen_fence_signalled(screen, fence);
|
|
||||||
|
|
||||||
if (fd_pipe_wait(fence->screen->pipe, fence->timestamp))
|
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
|
|
@ -34,8 +34,6 @@
|
||||||
void fd_screen_fence_ref(struct pipe_screen *pscreen,
|
void fd_screen_fence_ref(struct pipe_screen *pscreen,
|
||||||
struct pipe_fence_handle **ptr,
|
struct pipe_fence_handle **ptr,
|
||||||
struct pipe_fence_handle *pfence);
|
struct pipe_fence_handle *pfence);
|
||||||
boolean fd_screen_fence_signalled(struct pipe_screen *screen,
|
|
||||||
struct pipe_fence_handle *pfence);
|
|
||||||
boolean fd_screen_fence_finish(struct pipe_screen *screen,
|
boolean fd_screen_fence_finish(struct pipe_screen *screen,
|
||||||
struct pipe_fence_handle *pfence,
|
struct pipe_fence_handle *pfence,
|
||||||
uint64_t timeout);
|
uint64_t timeout);
|
||||||
|
|
Loading…
Reference in New Issue