diff options
author | Mikko Perttunen <mperttunen@nvidia.com> | 2023-01-19 16:09:21 +0300 |
---|---|---|
committer | Thierry Reding <treding@nvidia.com> | 2023-01-26 17:55:38 +0300 |
commit | d5179020f5ce44fd449790a9c12ef6c1a90a2ca7 (patch) | |
tree | b23507f69bf4ea56a40f7261a67ad8a8a04c5f71 /drivers/gpu/host1x/syncpt.c | |
parent | 625d4ffb438cacc9b1ebaa48748cdc7171587cdc (diff) | |
download | linux-d5179020f5ce44fd449790a9c12ef6c1a90a2ca7.tar.xz |
gpu: host1x: External timeout/cancellation for fences
Currently all fences have a 30 second timeout to ensure they are
cleaned up if the fence never completes otherwise. However, this
one size fits all solution doesn't actually fit in every case,
such as syncpoint waiting where we want to be able to have timeouts
longer than 30 seconds. As such, we want to be able to give control
over fence cancellation to the caller (and maybe eventually get rid
of the internal timeout altogether).
Here we add this cancellation mechanism by essentially adding a
function for entering the timeout path by function call, and changing
the syncpoint wait function to use it.
Signed-off-by: Mikko Perttunen <mperttunen@nvidia.com>
Signed-off-by: Thierry Reding <treding@nvidia.com>
Diffstat (limited to 'drivers/gpu/host1x/syncpt.c')
-rw-r--r-- | drivers/gpu/host1x/syncpt.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/gpu/host1x/syncpt.c b/drivers/gpu/host1x/syncpt.c index 75f58ec2ae23..2d2007760eac 100644 --- a/drivers/gpu/host1x/syncpt.c +++ b/drivers/gpu/host1x/syncpt.c @@ -236,11 +236,13 @@ int host1x_syncpt_wait(struct host1x_syncpt *sp, u32 thresh, long timeout, else if (timeout == 0) return -EAGAIN; - fence = host1x_fence_create(sp, thresh); + fence = host1x_fence_create(sp, thresh, false); if (IS_ERR(fence)) return PTR_ERR(fence); wait_err = dma_fence_wait_timeout(fence, true, timeout); + if (wait_err == 0) + host1x_fence_cancel(fence); dma_fence_put(fence); if (value) |