gpu: host1x: Implement job tracking using DMA fences

In anticipation of removal of the intr API, implement job tracking
using DMA fences instead. The main two things about this are
making cdma_update schedule the work since fence completion can
now be called from interrupt context, and some complication in
ensuring the callback is not running when we free the fence.

Signed-off-by: Mikko Perttunen <mperttunen@nvidia.com>
Signed-off-by: Thierry Reding <treding@nvidia.com>
This commit is contained in:
Mikko Perttunen
2023-01-19 15:09:19 +02:00
committed by Thierry Reding
parent f0fb260a0c
commit c24973ed79
5 changed files with 53 additions and 29 deletions

View File

@@ -8,6 +8,7 @@
#include <linux/device.h>
#include <linux/dma-direction.h>
#include <linux/dma-fence.h>
#include <linux/spinlock.h>
#include <linux/types.h>
@@ -288,8 +289,9 @@ struct host1x_job {
u32 syncpt_incrs;
u32 syncpt_end;
/* Completion waiter ref */
void *waiter;
/* Completion fence for job tracking */
struct dma_fence *fence;
struct dma_fence_cb fence_cb;
/* Maximum time to wait for this job */
unsigned int timeout;