• Home
  • Raw
  • Download

Lines Matching refs:job

30 nouveau_job_init(struct nouveau_job *job,  in nouveau_job_init()  argument
36 job->file_priv = args->file_priv; in nouveau_job_init()
37 job->cli = nouveau_cli(args->file_priv); in nouveau_job_init()
38 job->entity = entity; in nouveau_job_init()
40 job->sync = args->sync; in nouveau_job_init()
41 job->resv_usage = args->resv_usage; in nouveau_job_init()
43 job->ops = args->ops; in nouveau_job_init()
45 job->in_sync.count = args->in_sync.count; in nouveau_job_init()
46 if (job->in_sync.count) { in nouveau_job_init()
47 if (job->sync) in nouveau_job_init()
50 job->in_sync.data = kmemdup(args->in_sync.s, in nouveau_job_init()
54 if (!job->in_sync.data) in nouveau_job_init()
58 job->out_sync.count = args->out_sync.count; in nouveau_job_init()
59 if (job->out_sync.count) { in nouveau_job_init()
60 if (job->sync) { in nouveau_job_init()
65 job->out_sync.data = kmemdup(args->out_sync.s, in nouveau_job_init()
69 if (!job->out_sync.data) { in nouveau_job_init()
74 job->out_sync.objs = kcalloc(job->out_sync.count, in nouveau_job_init()
75 sizeof(*job->out_sync.objs), in nouveau_job_init()
77 if (!job->out_sync.objs) { in nouveau_job_init()
82 job->out_sync.chains = kcalloc(job->out_sync.count, in nouveau_job_init()
83 sizeof(*job->out_sync.chains), in nouveau_job_init()
85 if (!job->out_sync.chains) { in nouveau_job_init()
92 ret = drm_sched_job_init(&job->base, &entity->base, NULL); in nouveau_job_init()
96 job->state = NOUVEAU_JOB_INITIALIZED; in nouveau_job_init()
101 kfree(job->out_sync.chains); in nouveau_job_init()
103 kfree(job->out_sync.objs); in nouveau_job_init()
105 kfree(job->out_sync.data); in nouveau_job_init()
107 kfree(job->in_sync.data); in nouveau_job_init()
112 nouveau_job_free(struct nouveau_job *job) in nouveau_job_free() argument
114 kfree(job->in_sync.data); in nouveau_job_free()
115 kfree(job->out_sync.data); in nouveau_job_free()
116 kfree(job->out_sync.objs); in nouveau_job_free()
117 kfree(job->out_sync.chains); in nouveau_job_free()
120 void nouveau_job_fini(struct nouveau_job *job) in nouveau_job_fini() argument
122 dma_fence_put(job->done_fence); in nouveau_job_fini()
123 drm_sched_job_cleanup(&job->base); in nouveau_job_fini()
124 job->ops->free(job); in nouveau_job_fini()
128 sync_find_fence(struct nouveau_job *job, in sync_find_fence() argument
143 ret = drm_syncobj_find_fence(job->file_priv, in sync_find_fence()
153 nouveau_job_add_deps(struct nouveau_job *job) in nouveau_job_add_deps() argument
158 for (i = 0; i < job->in_sync.count; i++) { in nouveau_job_add_deps()
159 struct drm_nouveau_sync *sync = &job->in_sync.data[i]; in nouveau_job_add_deps()
161 ret = sync_find_fence(job, sync, &in_fence); in nouveau_job_add_deps()
163 NV_PRINTK(warn, job->cli, in nouveau_job_add_deps()
169 ret = drm_sched_job_add_dependency(&job->base, in_fence); in nouveau_job_add_deps()
178 nouveau_job_fence_attach_cleanup(struct nouveau_job *job) in nouveau_job_fence_attach_cleanup() argument
182 for (i = 0; i < job->out_sync.count; i++) { in nouveau_job_fence_attach_cleanup()
183 struct drm_syncobj *obj = job->out_sync.objs[i]; in nouveau_job_fence_attach_cleanup()
184 struct dma_fence_chain *chain = job->out_sync.chains[i]; in nouveau_job_fence_attach_cleanup()
195 nouveau_job_fence_attach_prepare(struct nouveau_job *job) in nouveau_job_fence_attach_prepare() argument
199 for (i = 0; i < job->out_sync.count; i++) { in nouveau_job_fence_attach_prepare()
200 struct drm_nouveau_sync *sync = &job->out_sync.data[i]; in nouveau_job_fence_attach_prepare()
201 struct drm_syncobj **pobj = &job->out_sync.objs[i]; in nouveau_job_fence_attach_prepare()
202 struct dma_fence_chain **pchain = &job->out_sync.chains[i]; in nouveau_job_fence_attach_prepare()
211 *pobj = drm_syncobj_find(job->file_priv, sync->handle); in nouveau_job_fence_attach_prepare()
213 NV_PRINTK(warn, job->cli, in nouveau_job_fence_attach_prepare()
232 nouveau_job_fence_attach_cleanup(job); in nouveau_job_fence_attach_prepare()
237 nouveau_job_fence_attach(struct nouveau_job *job) in nouveau_job_fence_attach() argument
239 struct dma_fence *fence = job->done_fence; in nouveau_job_fence_attach()
242 for (i = 0; i < job->out_sync.count; i++) { in nouveau_job_fence_attach()
243 struct drm_nouveau_sync *sync = &job->out_sync.data[i]; in nouveau_job_fence_attach()
244 struct drm_syncobj **pobj = &job->out_sync.objs[i]; in nouveau_job_fence_attach()
245 struct dma_fence_chain **pchain = &job->out_sync.chains[i]; in nouveau_job_fence_attach()
262 nouveau_job_submit(struct nouveau_job *job) in nouveau_job_submit() argument
264 struct nouveau_sched_entity *entity = to_nouveau_sched_entity(job->base.entity); in nouveau_job_submit()
268 ret = nouveau_job_add_deps(job); in nouveau_job_submit()
272 ret = nouveau_job_fence_attach_prepare(job); in nouveau_job_submit()
284 if (job->ops->submit) { in nouveau_job_submit()
285 ret = job->ops->submit(job); in nouveau_job_submit()
290 drm_sched_job_arm(&job->base); in nouveau_job_submit()
291 job->done_fence = dma_fence_get(&job->base.s_fence->finished); in nouveau_job_submit()
292 if (job->sync) in nouveau_job_submit()
293 done_fence = dma_fence_get(job->done_fence); in nouveau_job_submit()
315 set_bit(DRM_SCHED_FENCE_DONT_PIPELINE, &job->done_fence->flags); in nouveau_job_submit()
317 if (job->ops->armed_submit) in nouveau_job_submit()
318 job->ops->armed_submit(job); in nouveau_job_submit()
320 nouveau_job_fence_attach(job); in nouveau_job_submit()
325 job->state = NOUVEAU_JOB_SUBMIT_SUCCESS; in nouveau_job_submit()
327 drm_sched_entity_push_job(&job->base); in nouveau_job_submit()
340 nouveau_job_fence_attach_cleanup(job); in nouveau_job_submit()
342 job->state = NOUVEAU_JOB_SUBMIT_FAILED; in nouveau_job_submit()
354 nouveau_job_run(struct nouveau_job *job) in nouveau_job_run() argument
358 fence = job->ops->run(job); in nouveau_job_run()
360 job->state = NOUVEAU_JOB_RUN_FAILED; in nouveau_job_run()
362 job->state = NOUVEAU_JOB_RUN_SUCCESS; in nouveau_job_run()
370 struct nouveau_job *job = to_nouveau_job(sched_job); in nouveau_sched_run_job() local
372 return nouveau_job_run(job); in nouveau_sched_run_job()
379 struct nouveau_job *job = to_nouveau_job(sched_job); in nouveau_sched_timedout_job() local
384 if (job->ops->timeout) in nouveau_sched_timedout_job()
385 stat = job->ops->timeout(job); in nouveau_sched_timedout_job()
387 NV_PRINTK(warn, job->cli, "Generic job timeout.\n"); in nouveau_sched_timedout_job()
397 struct nouveau_job *job = to_nouveau_job(sched_job); in nouveau_sched_free_job() local
399 nouveau_job_fini(job); in nouveau_sched_free_job()
407 spin_lock_init(&entity->job.list.lock); in nouveau_sched_entity_init()
408 INIT_LIST_HEAD(&entity->job.list.head); in nouveau_sched_entity_init()
409 init_waitqueue_head(&entity->job.wq); in nouveau_sched_entity_init()