diff options
author | Mikko Perttunen <mperttunen@nvidia.com> | 2023-01-19 16:09:19 +0300 |
---|---|---|
committer | Thierry Reding <treding@nvidia.com> | 2023-01-26 17:55:38 +0300 |
commit | c24973ed795fec5c12d8a822a0de99a4b7bab394 (patch) | |
tree | 3507e29c7b652925357359aeafde1298e0142826 /drivers/gpu/host1x/cdma.c | |
parent | f0fb260a0cdb014b22a5f7733279c205f2cba62a (diff) | |
download | linux-c24973ed795fec5c12d8a822a0de99a4b7bab394.tar.xz |
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/cdma.c')
-rw-r--r-- | drivers/gpu/host1x/cdma.c | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/drivers/gpu/host1x/cdma.c b/drivers/gpu/host1x/cdma.c index 103fda055394..bc821b0ed908 100644 --- a/drivers/gpu/host1x/cdma.c +++ b/drivers/gpu/host1x/cdma.c @@ -490,6 +490,15 @@ resume: host1x_hw_cdma_resume(host1x, cdma, restart_addr); } +static void cdma_update_work(struct work_struct *work) +{ + struct host1x_cdma *cdma = container_of(work, struct host1x_cdma, update_work); + + mutex_lock(&cdma->lock); + update_cdma_locked(cdma); + mutex_unlock(&cdma->lock); +} + /* * Create a cdma */ @@ -499,6 +508,7 @@ int host1x_cdma_init(struct host1x_cdma *cdma) mutex_init(&cdma->lock); init_completion(&cdma->complete); + INIT_WORK(&cdma->update_work, cdma_update_work); INIT_LIST_HEAD(&cdma->sync_queue); @@ -679,7 +689,5 @@ void host1x_cdma_end(struct host1x_cdma *cdma, */ void host1x_cdma_update(struct host1x_cdma *cdma) { - mutex_lock(&cdma->lock); - update_cdma_locked(cdma); - mutex_unlock(&cdma->lock); + schedule_work(&cdma->update_work); } |