Lines Matching full:job

33 	struct amdxdna_sched_job *job;  in aie2_job_release()  local
35 job = container_of(ref, struct amdxdna_sched_job, refcnt); in aie2_job_release()
36 amdxdna_sched_job_cleanup(job); in aie2_job_release()
37 if (job->out_fence) in aie2_job_release()
38 dma_fence_put(job->out_fence); in aie2_job_release()
39 kfree(job); in aie2_job_release()
42 static void aie2_job_put(struct amdxdna_sched_job *job) in aie2_job_put() argument
44 kref_put(&job->refcnt, aie2_job_release); in aie2_job_put()
172 aie2_sched_notify(struct amdxdna_sched_job *job) in aie2_sched_notify() argument
174 struct dma_fence *fence = job->fence; in aie2_sched_notify()
176 trace_xdna_job(&job->base, job->hwctx->name, "signaled fence", job->seq); in aie2_sched_notify()
177 job->hwctx->priv->completed++; in aie2_sched_notify()
180 up(&job->hwctx->priv->job_sem); in aie2_sched_notify()
181 job->job_done = true; in aie2_sched_notify()
183 mmput_async(job->mm); in aie2_sched_notify()
184 aie2_job_put(job); in aie2_sched_notify()
190 struct amdxdna_sched_job *job = handle; in aie2_sched_resp_handler() local
195 cmd_abo = job->cmd_bo; in aie2_sched_resp_handler()
207 XDNA_DBG(job->hwctx->client->xdna, "Resp status 0x%x", status); in aie2_sched_resp_handler()
214 aie2_sched_notify(job); in aie2_sched_resp_handler()
221 struct amdxdna_sched_job *job = handle; in aie2_sched_nocmd_resp_handler() local
234 XDNA_DBG(job->hwctx->client->xdna, "Resp status 0x%x", status); in aie2_sched_nocmd_resp_handler()
237 aie2_sched_notify(job); in aie2_sched_nocmd_resp_handler()
244 struct amdxdna_sched_job *job = handle; in aie2_sched_cmdlist_resp_handler() local
252 cmd_abo = job->cmd_bo; in aie2_sched_cmdlist_resp_handler()
260 xdna = job->hwctx->client->xdna; in aie2_sched_cmdlist_resp_handler()
288 aie2_sched_notify(job); in aie2_sched_cmdlist_resp_handler()
295 struct amdxdna_sched_job *job = drm_job_to_xdna_job(sched_job); in aie2_sched_job_run() local
296 struct amdxdna_gem_obj *cmd_abo = job->cmd_bo; in aie2_sched_job_run()
297 struct amdxdna_hwctx *hwctx = job->hwctx; in aie2_sched_job_run()
301 if (!mmget_not_zero(job->mm)) in aie2_sched_job_run()
304 kref_get(&job->refcnt); in aie2_sched_job_run()
305 fence = dma_fence_get(job->fence); in aie2_sched_job_run()
308 ret = aie2_sync_bo(hwctx, job, aie2_sched_nocmd_resp_handler); in aie2_sched_job_run()
315 ret = aie2_cmdlist_multi_execbuf(hwctx, job, aie2_sched_cmdlist_resp_handler); in aie2_sched_job_run()
317 ret = aie2_cmdlist_single_execbuf(hwctx, job, aie2_sched_cmdlist_resp_handler); in aie2_sched_job_run()
319 ret = aie2_execbuf(hwctx, job, aie2_sched_resp_handler); in aie2_sched_job_run()
323 dma_fence_put(job->fence); in aie2_sched_job_run()
324 aie2_job_put(job); in aie2_sched_job_run()
325 mmput(job->mm); in aie2_sched_job_run()
328 trace_xdna_job(sched_job, hwctx->name, "sent to device", job->seq); in aie2_sched_job_run()
335 struct amdxdna_sched_job *job = drm_job_to_xdna_job(sched_job); in aie2_sched_job_free() local
336 struct amdxdna_hwctx *hwctx = job->hwctx; in aie2_sched_job_free()
338 trace_xdna_job(sched_job, hwctx->name, "job free", job->seq); in aie2_sched_job_free()
339 if (!job->job_done) in aie2_sched_job_free()
343 aie2_job_put(job); in aie2_sched_job_free()
349 struct amdxdna_sched_job *job = drm_job_to_xdna_job(sched_job); in aie2_sched_job_timedout() local
350 struct amdxdna_hwctx *hwctx = job->hwctx; in aie2_sched_job_timedout()
354 trace_xdna_job(sched_job, hwctx->name, "job timedout", job->seq); in aie2_sched_job_timedout()
800 int aie2_cmd_submit(struct amdxdna_hwctx *hwctx, struct amdxdna_sched_job *job, u64 *seq) in aie2_cmd_submit() argument
811 XDNA_ERR(xdna, "Grab job sem failed, ret %d", ret); in aie2_cmd_submit()
822 ret = drm_sched_job_init(&job->base, &hwctx->priv->entity, 1, hwctx); in aie2_cmd_submit()
824 XDNA_ERR(xdna, "DRM job init failed, ret %d", ret); in aie2_cmd_submit()
829 ret = drm_gem_lock_reservations(job->bos, job->bo_cnt, &acquire_ctx); in aie2_cmd_submit()
835 for (i = 0; i < job->bo_cnt; i++) { in aie2_cmd_submit()
836 ret = dma_resv_reserve_fences(job->bos[i]->resv, 1); in aie2_cmd_submit()
839 drm_gem_unlock_reservations(job->bos, job->bo_cnt, &acquire_ctx); in aie2_cmd_submit()
845 for (i = 0; i < job->bo_cnt; i++) { in aie2_cmd_submit()
846 abo = to_xdna_obj(job->bos[i]); in aie2_cmd_submit()
849 drm_gem_unlock_reservations(job->bos, job->bo_cnt, &acquire_ctx); in aie2_cmd_submit()
866 drm_sched_job_arm(&job->base); in aie2_cmd_submit()
867 job->out_fence = dma_fence_get(&job->base.s_fence->finished); in aie2_cmd_submit()
868 for (i = 0; i < job->bo_cnt; i++) in aie2_cmd_submit()
869 dma_resv_add_fence(job->bos[i]->resv, job->out_fence, DMA_RESV_USAGE_WRITE); in aie2_cmd_submit()
870 job->seq = hwctx->priv->seq++; in aie2_cmd_submit()
871 kref_get(&job->refcnt); in aie2_cmd_submit()
872 drm_sched_entity_push_job(&job->base); in aie2_cmd_submit()
874 *seq = job->seq; in aie2_cmd_submit()
875 drm_syncobj_add_point(hwctx->priv->syncobj, chain, job->out_fence, *seq); in aie2_cmd_submit()
879 drm_gem_unlock_reservations(job->bos, job->bo_cnt, &acquire_ctx); in aie2_cmd_submit()
881 aie2_job_put(job); in aie2_cmd_submit()
886 drm_sched_job_cleanup(&job->base); in aie2_cmd_submit()
891 job->job_done = true; in aie2_cmd_submit()