Lines Matching refs:job
33 struct amdxdna_sched_job *job;
35 job = container_of(ref, struct amdxdna_sched_job, refcnt);
36 amdxdna_sched_job_cleanup(job);
37 atomic64_inc(&job->hwctx->job_free_cnt);
38 wake_up(&job->hwctx->priv->job_free_wq);
39 if (job->out_fence)
40 dma_fence_put(job->out_fence);
41 kfree(job);
44 static void aie2_job_put(struct amdxdna_sched_job *job)
46 kref_put(&job->refcnt, aie2_job_release);
175 aie2_sched_notify(struct amdxdna_sched_job *job)
177 struct dma_fence *fence = job->fence;
179 trace_xdna_job(&job->base, job->hwctx->name, "signaled fence", job->seq);
180 job->hwctx->priv->completed++;
183 up(&job->hwctx->priv->job_sem);
184 job->job_done = true;
186 mmput_async(job->mm);
187 aie2_job_put(job);
193 struct amdxdna_sched_job *job = handle;
198 cmd_abo = job->cmd_bo;
210 XDNA_DBG(job->hwctx->client->xdna, "Resp status 0x%x", status);
217 aie2_sched_notify(job);
224 struct amdxdna_sched_job *job = handle;
237 XDNA_DBG(job->hwctx->client->xdna, "Resp status 0x%x", status);
240 aie2_sched_notify(job);
247 struct amdxdna_sched_job *job = handle;
255 cmd_abo = job->cmd_bo;
263 xdna = job->hwctx->client->xdna;
291 aie2_sched_notify(job);
298 struct amdxdna_sched_job *job = drm_job_to_xdna_job(sched_job);
299 struct amdxdna_gem_obj *cmd_abo = job->cmd_bo;
300 struct amdxdna_hwctx *hwctx = job->hwctx;
304 if (!mmget_not_zero(job->mm))
307 kref_get(&job->refcnt);
308 fence = dma_fence_get(job->fence);
311 ret = aie2_sync_bo(hwctx, job, aie2_sched_nocmd_resp_handler);
318 ret = aie2_cmdlist_multi_execbuf(hwctx, job, aie2_sched_cmdlist_resp_handler);
320 ret = aie2_cmdlist_single_execbuf(hwctx, job, aie2_sched_cmdlist_resp_handler);
322 ret = aie2_execbuf(hwctx, job, aie2_sched_resp_handler);
326 dma_fence_put(job->fence);
327 aie2_job_put(job);
328 mmput(job->mm);
331 trace_xdna_job(sched_job, hwctx->name, "sent to device", job->seq);
338 struct amdxdna_sched_job *job = drm_job_to_xdna_job(sched_job);
339 struct amdxdna_hwctx *hwctx = job->hwctx;
341 trace_xdna_job(sched_job, hwctx->name, "job free", job->seq);
342 if (!job->job_done)
346 aie2_job_put(job);
352 struct amdxdna_sched_job *job = drm_job_to_xdna_job(sched_job);
353 struct amdxdna_hwctx *hwctx = job->hwctx;
357 trace_xdna_job(sched_job, hwctx->name, "job timedout", job->seq);
829 int aie2_cmd_submit(struct amdxdna_hwctx *hwctx, struct amdxdna_sched_job *job, u64 *seq)
840 XDNA_ERR(xdna, "Grab job sem failed, ret %d", ret);
851 ret = drm_sched_job_init(&job->base, &hwctx->priv->entity, 1, hwctx,
854 XDNA_ERR(xdna, "DRM job init failed, ret %d", ret);
859 ret = drm_gem_lock_reservations(job->bos, job->bo_cnt, &acquire_ctx);
865 for (i = 0; i < job->bo_cnt; i++) {
866 ret = dma_resv_reserve_fences(job->bos[i]->resv, 1);
869 drm_gem_unlock_reservations(job->bos, job->bo_cnt, &acquire_ctx);
875 for (i = 0; i < job->bo_cnt; i++) {
876 abo = to_xdna_obj(job->bos[i]);
879 drm_gem_unlock_reservations(job->bos, job->bo_cnt, &acquire_ctx);
896 drm_sched_job_arm(&job->base);
897 job->out_fence = dma_fence_get(&job->base.s_fence->finished);
898 for (i = 0; i < job->bo_cnt; i++)
899 dma_resv_add_fence(job->bos[i]->resv, job->out_fence, DMA_RESV_USAGE_WRITE);
900 job->seq = hwctx->priv->seq++;
901 kref_get(&job->refcnt);
902 drm_sched_entity_push_job(&job->base);
904 *seq = job->seq;
905 drm_syncobj_add_point(hwctx->priv->syncobj, chain, job->out_fence, *seq);
909 drm_gem_unlock_reservations(job->bos, job->bo_cnt, &acquire_ctx);
911 aie2_job_put(job);
917 drm_sched_job_cleanup(&job->base);
922 job->job_done = true;