d5179020f5
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>
31 lines
483 B
C
31 lines
483 B
C
/* SPDX-License-Identifier: GPL-2.0-only */
|
|
/*
|
|
* Copyright (c) 2020, NVIDIA Corporation.
|
|
*/
|
|
|
|
#ifndef HOST1X_FENCE_H
|
|
#define HOST1X_FENCE_H
|
|
|
|
struct host1x_syncpt_fence {
|
|
struct dma_fence base;
|
|
|
|
atomic_t signaling;
|
|
|
|
struct host1x_syncpt *sp;
|
|
u32 threshold;
|
|
bool timeout;
|
|
|
|
struct delayed_work timeout_work;
|
|
|
|
struct list_head list;
|
|
};
|
|
|
|
struct host1x_fence_list {
|
|
spinlock_t lock;
|
|
struct list_head list;
|
|
};
|
|
|
|
void host1x_fence_signal(struct host1x_syncpt_fence *fence);
|
|
|
|
#endif
|