Lines Matching refs:pipe
17 struct lima_sched_pipe *pipe; member
59 return f->pipe->base.name; in lima_fence_get_timeline_name()
83 static struct lima_fence *lima_fence_create(struct lima_sched_pipe *pipe) in lima_fence_create() argument
91 fence->pipe = pipe; in lima_fence_create()
92 dma_fence_init(&fence->base, &lima_fence_ops, &pipe->fence_lock, in lima_fence_create()
93 pipe->fence_context, ++pipe->fence_seqno); in lima_fence_create()
158 int lima_sched_context_init(struct lima_sched_pipe *pipe, in lima_sched_context_init() argument
162 struct drm_sched_rq *rq = pipe->base.sched_rq + DRM_SCHED_PRIORITY_NORMAL; in lima_sched_context_init()
167 void lima_sched_context_fini(struct lima_sched_pipe *pipe, in lima_sched_context_fini() argument
196 struct lima_sched_pipe *pipe = to_lima_pipe(job->sched); in lima_sched_run_job() local
206 fence = lima_fence_create(pipe); in lima_sched_run_job()
216 pipe->current_task = task; in lima_sched_run_job()
233 for (i = 0; i < pipe->num_l2_cache; i++) in lima_sched_run_job()
234 lima_l2_cache_flush(pipe->l2_cache[i]); in lima_sched_run_job()
236 if (task->vm != pipe->current_vm) { in lima_sched_run_job()
238 last_vm = pipe->current_vm; in lima_sched_run_job()
239 pipe->current_vm = task->vm; in lima_sched_run_job()
242 if (pipe->bcast_mmu) in lima_sched_run_job()
243 lima_mmu_switch_vm(pipe->bcast_mmu, vm); in lima_sched_run_job()
245 for (i = 0; i < pipe->num_mmu; i++) in lima_sched_run_job()
246 lima_mmu_switch_vm(pipe->mmu[i], vm); in lima_sched_run_job()
252 pipe->error = false; in lima_sched_run_job()
253 pipe->task_run(pipe, task); in lima_sched_run_job()
258 static void lima_sched_handle_error_task(struct lima_sched_pipe *pipe, in lima_sched_handle_error_task() argument
261 drm_sched_stop(&pipe->base, &task->base); in lima_sched_handle_error_task()
266 pipe->task_error(pipe); in lima_sched_handle_error_task()
268 if (pipe->bcast_mmu) in lima_sched_handle_error_task()
269 lima_mmu_page_fault_resume(pipe->bcast_mmu); in lima_sched_handle_error_task()
273 for (i = 0; i < pipe->num_mmu; i++) in lima_sched_handle_error_task()
274 lima_mmu_page_fault_resume(pipe->mmu[i]); in lima_sched_handle_error_task()
277 if (pipe->current_vm) in lima_sched_handle_error_task()
278 lima_vm_put(pipe->current_vm); in lima_sched_handle_error_task()
280 pipe->current_vm = NULL; in lima_sched_handle_error_task()
281 pipe->current_task = NULL; in lima_sched_handle_error_task()
283 drm_sched_resubmit_jobs(&pipe->base); in lima_sched_handle_error_task()
284 drm_sched_start(&pipe->base, true); in lima_sched_handle_error_task()
289 struct lima_sched_pipe *pipe = to_lima_pipe(job->sched); in lima_sched_timedout_job() local
294 lima_sched_handle_error_task(pipe, task); in lima_sched_timedout_job()
300 struct lima_sched_pipe *pipe = to_lima_pipe(job->sched); in lima_sched_free_job() local
311 kmem_cache_free(pipe->task_slab, task); in lima_sched_free_job()
323 struct lima_sched_pipe *pipe = in lima_sched_error_work() local
325 struct lima_sched_task *task = pipe->current_task; in lima_sched_error_work()
327 lima_sched_handle_error_task(pipe, task); in lima_sched_error_work()
330 int lima_sched_pipe_init(struct lima_sched_pipe *pipe, const char *name) in lima_sched_pipe_init() argument
335 pipe->fence_context = dma_fence_context_alloc(1); in lima_sched_pipe_init()
336 spin_lock_init(&pipe->fence_lock); in lima_sched_pipe_init()
338 INIT_WORK(&pipe->error_work, lima_sched_error_work); in lima_sched_pipe_init()
340 return drm_sched_init(&pipe->base, &lima_sched_ops, 1, 0, in lima_sched_pipe_init()
344 void lima_sched_pipe_fini(struct lima_sched_pipe *pipe) in lima_sched_pipe_fini() argument
346 drm_sched_fini(&pipe->base); in lima_sched_pipe_fini()
349 void lima_sched_pipe_task_done(struct lima_sched_pipe *pipe) in lima_sched_pipe_task_done() argument
351 if (pipe->error) in lima_sched_pipe_task_done()
352 schedule_work(&pipe->error_work); in lima_sched_pipe_task_done()
354 struct lima_sched_task *task = pipe->current_task; in lima_sched_pipe_task_done()
356 pipe->task_fini(pipe); in lima_sched_pipe_task_done()