diff options
author | Mikko Perttunen <mperttunen@nvidia.com> | 2023-01-19 15:09:19 +0200 |
---|---|---|
committer | Thierry Reding <treding@nvidia.com> | 2023-01-26 15:55:38 +0100 |
commit | c24973ed795fec5c12d8a822a0de99a4b7bab394 (patch) | |
tree | 3507e29c7b652925357359aeafde1298e0142826 /drivers/gpu/host1x/job.c | |
parent | f0fb260a0cdb014b22a5f7733279c205f2cba62a (diff) | |
download | linux-c24973ed795fec5c12d8a822a0de99a4b7bab394.tar.gz linux-c24973ed795fec5c12d8a822a0de99a4b7bab394.tar.bz2 linux-c24973ed795fec5c12d8a822a0de99a4b7bab394.zip |
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>
Diffstat (limited to 'drivers/gpu/host1x/job.c')
-rw-r--r-- | drivers/gpu/host1x/job.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/drivers/gpu/host1x/job.c b/drivers/gpu/host1x/job.c index b2761aa03b95..3ed49e1fd933 100644 --- a/drivers/gpu/host1x/job.c +++ b/drivers/gpu/host1x/job.c @@ -88,9 +88,15 @@ static void job_free(struct kref *ref) if (job->release) job->release(job); - if (job->waiter) - host1x_intr_put_ref(job->syncpt->host, job->syncpt->id, - job->waiter, false); + if (job->fence) { + /* + * remove_callback is atomic w.r.t. fence signaling, so + * after the call returns, we know that the callback is not + * in execution, and the fence can be safely freed. + */ + dma_fence_remove_callback(job->fence, &job->fence_cb); + dma_fence_put(job->fence); + } if (job->syncpt) host1x_syncpt_put(job->syncpt); |