drm/lima: use scheduler dependency tracking
Nothing special going on here. Aside reviewing the code, it seems like drm_sched_job_arm() should be moved into lima_sched_context_queue_task and put under some mutex together with drm_sched_push_job(). See the kerneldoc for drm_sched_push_job(). v2: Rebase over renamed functions to add dependencies. Reviewed-by: Qiang Yu <yuq825@gmail.com> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com> Cc: Qiang Yu <yuq825@gmail.com> Cc: Sumit Semwal <sumit.semwal@linaro.org> Cc: "Christian König" <christian.koenig@amd.com> Cc: lima@lists.freedesktop.org Cc: linux-media@vger.kernel.org Cc: linaro-mm-sig@lists.linaro.org Link: https://patchwork.freedesktop.org/patch/msgid/20210805104705.862416-9-daniel.vetter@ffwll.ch
This commit is contained in:
@@ -134,24 +134,15 @@ int lima_sched_task_init(struct lima_sched_task *task,
|
||||
task->num_bos = num_bos;
|
||||
task->vm = lima_vm_get(vm);
|
||||
|
||||
xa_init_flags(&task->deps, XA_FLAGS_ALLOC);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
void lima_sched_task_fini(struct lima_sched_task *task)
|
||||
{
|
||||
struct dma_fence *fence;
|
||||
unsigned long index;
|
||||
int i;
|
||||
|
||||
drm_sched_job_cleanup(&task->base);
|
||||
|
||||
xa_for_each(&task->deps, index, fence) {
|
||||
dma_fence_put(fence);
|
||||
}
|
||||
xa_destroy(&task->deps);
|
||||
|
||||
if (task->bos) {
|
||||
for (i = 0; i < task->num_bos; i++)
|
||||
drm_gem_object_put(&task->bos[i]->base.base);
|
||||
@@ -186,17 +177,6 @@ struct dma_fence *lima_sched_context_queue_task(struct lima_sched_task *task)
|
||||
return fence;
|
||||
}
|
||||
|
||||
static struct dma_fence *lima_sched_dependency(struct drm_sched_job *job,
|
||||
struct drm_sched_entity *entity)
|
||||
{
|
||||
struct lima_sched_task *task = to_lima_task(job);
|
||||
|
||||
if (!xa_empty(&task->deps))
|
||||
return xa_erase(&task->deps, task->last_dep++);
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static int lima_pm_busy(struct lima_device *ldev)
|
||||
{
|
||||
int ret;
|
||||
@@ -472,7 +452,6 @@ static void lima_sched_free_job(struct drm_sched_job *job)
|
||||
}
|
||||
|
||||
static const struct drm_sched_backend_ops lima_sched_ops = {
|
||||
.dependency = lima_sched_dependency,
|
||||
.run_job = lima_sched_run_job,
|
||||
.timedout_job = lima_sched_timedout_job,
|
||||
.free_job = lima_sched_free_job,
|
||||
|
||||
Reference in New Issue
Block a user