Lines Matching full:task
112 int lima_sched_task_init(struct lima_sched_task *task, in lima_sched_task_init() argument
119 task->bos = kmemdup(bos, sizeof(*bos) * num_bos, GFP_KERNEL); in lima_sched_task_init()
120 if (!task->bos) in lima_sched_task_init()
126 err = drm_sched_job_init(&task->base, &context->base, vm); in lima_sched_task_init()
128 kfree(task->bos); in lima_sched_task_init()
132 drm_sched_job_arm(&task->base); in lima_sched_task_init()
134 task->num_bos = num_bos; in lima_sched_task_init()
135 task->vm = lima_vm_get(vm); in lima_sched_task_init()
140 void lima_sched_task_fini(struct lima_sched_task *task) in lima_sched_task_fini() argument
144 drm_sched_job_cleanup(&task->base); in lima_sched_task_fini()
146 if (task->bos) { in lima_sched_task_fini()
147 for (i = 0; i < task->num_bos; i++) in lima_sched_task_fini()
148 drm_gem_object_put(&task->bos[i]->base.base); in lima_sched_task_fini()
149 kfree(task->bos); in lima_sched_task_fini()
152 lima_vm_put(task->vm); in lima_sched_task_fini()
171 struct dma_fence *lima_sched_context_queue_task(struct lima_sched_task *task) in lima_sched_context_queue_task() argument
173 struct dma_fence *fence = dma_fence_get(&task->base.s_fence->finished); in lima_sched_context_queue_task()
175 trace_lima_task_submit(task); in lima_sched_context_queue_task()
176 drm_sched_entity_push_job(&task->base); in lima_sched_context_queue_task()
204 struct lima_sched_task *task = to_lima_task(job); in lima_sched_run_job() local
224 task->fence = &fence->base; in lima_sched_run_job()
229 dma_fence_get(task->fence); in lima_sched_run_job()
231 pipe->current_task = task; in lima_sched_run_job()
244 * 1. move this to task fini to save some wait time? in lima_sched_run_job()
252 pipe->current_vm = lima_vm_get(task->vm); in lima_sched_run_job()
261 trace_lima_task_run(task); in lima_sched_run_job()
264 pipe->task_run(pipe, task); in lima_sched_run_job()
266 return task->fence; in lima_sched_run_job()
269 static void lima_sched_build_error_task_list(struct lima_sched_task *task) in lima_sched_build_error_task_list() argument
272 struct lima_sched_pipe *pipe = to_lima_pipe(task->base.sched); in lima_sched_build_error_task_list()
277 container_of(task->base.entity, in lima_sched_build_error_task_list()
293 dev_info(dev->dev, "fail to save task state from %s pid %d: " in lima_sched_build_error_task_list()
294 "error task list is full\n", ctx->pname, ctx->pid); in lima_sched_build_error_task_list()
305 for (i = 0; i < task->num_bos; i++) { in lima_sched_build_error_task_list()
306 struct lima_bo *bo = task->bos[i]; in lima_sched_build_error_task_list()
316 dev_err(dev->dev, "fail to alloc task dump buffer of size %x\n", in lima_sched_build_error_task_list()
333 memcpy(chunk + 1, task->frame, pipe->frame_size); in lima_sched_build_error_task_list()
350 for (i = 0; i < task->num_bos; i++) { in lima_sched_build_error_task_list()
351 struct lima_bo *bo = task->bos[i]; in lima_sched_build_error_task_list()
356 buffer_chunk->va = lima_vm_get_va(task->vm, bo); in lima_sched_build_error_task_list()
393 dev_info(dev->dev, "save error task state success\n"); in lima_sched_build_error_task_list()
402 struct lima_sched_task *task = to_lima_task(job); in lima_sched_timedout_job() local
408 drm_sched_stop(&pipe->base, &task->base); in lima_sched_timedout_job()
410 drm_sched_increase_karma(&task->base); in lima_sched_timedout_job()
413 lima_sched_build_error_task_list(task); in lima_sched_timedout_job()
440 struct lima_sched_task *task = to_lima_task(job); in lima_sched_free_job() local
442 struct lima_vm *vm = task->vm; in lima_sched_free_job()
443 struct lima_bo **bos = task->bos; in lima_sched_free_job()
446 dma_fence_put(task->fence); in lima_sched_free_job()
448 for (i = 0; i < task->num_bos; i++) in lima_sched_free_job()
451 lima_sched_task_fini(task); in lima_sched_free_job()
452 kmem_cache_free(pipe->task_slab, task); in lima_sched_free_job()
504 struct lima_sched_task *task = pipe->current_task; in lima_sched_pipe_task_done() local
508 if (task && task->recoverable) in lima_sched_pipe_task_done()
514 dma_fence_signal(task->fence); in lima_sched_pipe_task_done()