Lines Matching refs:job

252 v3d_lock_bo_reservations(struct v3d_job *job,  in v3d_lock_bo_reservations()  argument
257 ret = drm_gem_lock_reservations(job->bo, job->bo_count, acquire_ctx); in v3d_lock_bo_reservations()
261 for (i = 0; i < job->bo_count; i++) { in v3d_lock_bo_reservations()
262 ret = dma_resv_reserve_fences(job->bo[i]->resv, 1); in v3d_lock_bo_reservations()
266 ret = drm_sched_job_add_implicit_dependencies(&job->base, in v3d_lock_bo_reservations()
267 job->bo[i], true); in v3d_lock_bo_reservations()
275 drm_gem_unlock_reservations(job->bo, job->bo_count, acquire_ctx); in v3d_lock_bo_reservations()
298 struct v3d_job *job, in v3d_lookup_bos() argument
302 job->bo_count = bo_count; in v3d_lookup_bos()
304 if (!job->bo_count) { in v3d_lookup_bos()
314 job->bo_count, &job->bo); in v3d_lookup_bos()
320 struct v3d_job *job = container_of(ref, struct v3d_job, refcount); in v3d_job_free() local
323 if (job->bo) { in v3d_job_free()
324 for (i = 0; i < job->bo_count; i++) in v3d_job_free()
325 drm_gem_object_put(job->bo[i]); in v3d_job_free()
326 kvfree(job->bo); in v3d_job_free()
329 dma_fence_put(job->irq_fence); in v3d_job_free()
330 dma_fence_put(job->done_fence); in v3d_job_free()
332 if (job->perfmon) in v3d_job_free()
333 v3d_perfmon_put(job->perfmon); in v3d_job_free()
335 kfree(job); in v3d_job_free()
341 struct v3d_render_job *job = container_of(ref, struct v3d_render_job, in v3d_render_job_free() local
345 list_for_each_entry_safe(bo, save, &job->unref_list, unref_head) { in v3d_render_job_free()
352 void v3d_job_cleanup(struct v3d_job *job) in v3d_job_cleanup() argument
354 if (!job) in v3d_job_cleanup()
357 drm_sched_job_cleanup(&job->base); in v3d_job_cleanup()
358 v3d_job_put(job); in v3d_job_cleanup()
361 void v3d_job_put(struct v3d_job *job) in v3d_job_put() argument
363 kref_put(&job->refcount, job->free); in v3d_job_put()
400 v3d_job_add_deps(struct drm_file *file_priv, struct v3d_job *job, in v3d_job_add_deps() argument
410 return drm_sched_job_add_dependency(&job->base, in_fence); in v3d_job_add_deps()
419 struct v3d_job *job; in v3d_job_init() local
429 job = *container; in v3d_job_init()
430 job->v3d = v3d; in v3d_job_init()
431 job->free = free; in v3d_job_init()
433 ret = drm_sched_job_init(&job->base, &v3d_priv->sched_entity[queue], in v3d_job_init()
450 ret = v3d_job_add_deps(file_priv, job, in.handle, 0); in v3d_job_init()
456 ret = v3d_job_add_deps(file_priv, job, in_sync, 0); in v3d_job_init()
461 kref_init(&job->refcount); in v3d_job_init()
466 drm_sched_job_cleanup(&job->base); in v3d_job_init()
475 v3d_push_job(struct v3d_job *job) in v3d_push_job() argument
477 drm_sched_job_arm(&job->base); in v3d_push_job()
479 job->done_fence = dma_fence_get(&job->base.s_fence->finished); in v3d_push_job()
482 kref_get(&job->refcount); in v3d_push_job()
484 drm_sched_entity_push_job(&job->base); in v3d_push_job()
489 struct v3d_job *job, in v3d_attach_fences_and_unlock_reservation() argument
499 for (i = 0; i < job->bo_count; i++) { in v3d_attach_fences_and_unlock_reservation()
501 dma_resv_add_fence(job->bo[i]->resv, job->done_fence, in v3d_attach_fences_and_unlock_reservation()
505 drm_gem_unlock_reservations(job->bo, job->bo_count, acquire_ctx); in v3d_attach_fences_and_unlock_reservation()
831 struct v3d_tfu_job *job = NULL; in v3d_submit_tfu_ioctl() local
850 ret = v3d_job_init(v3d, file_priv, (void *)&job, sizeof(*job), in v3d_submit_tfu_ioctl()
855 job->base.bo = kcalloc(ARRAY_SIZE(args->bo_handles), in v3d_submit_tfu_ioctl()
856 sizeof(*job->base.bo), GFP_KERNEL); in v3d_submit_tfu_ioctl()
857 if (!job->base.bo) { in v3d_submit_tfu_ioctl()
862 job->args = *args; in v3d_submit_tfu_ioctl()
864 for (job->base.bo_count = 0; in v3d_submit_tfu_ioctl()
865 job->base.bo_count < ARRAY_SIZE(args->bo_handles); in v3d_submit_tfu_ioctl()
866 job->base.bo_count++) { in v3d_submit_tfu_ioctl()
869 if (!args->bo_handles[job->base.bo_count]) in v3d_submit_tfu_ioctl()
872 bo = drm_gem_object_lookup(file_priv, args->bo_handles[job->base.bo_count]); in v3d_submit_tfu_ioctl()
875 job->base.bo_count, in v3d_submit_tfu_ioctl()
876 args->bo_handles[job->base.bo_count]); in v3d_submit_tfu_ioctl()
880 job->base.bo[job->base.bo_count] = bo; in v3d_submit_tfu_ioctl()
883 ret = v3d_lock_bo_reservations(&job->base, &acquire_ctx); in v3d_submit_tfu_ioctl()
888 v3d_push_job(&job->base); in v3d_submit_tfu_ioctl()
892 &job->base, &acquire_ctx, in v3d_submit_tfu_ioctl()
895 job->base.done_fence); in v3d_submit_tfu_ioctl()
897 v3d_job_put(&job->base); in v3d_submit_tfu_ioctl()
902 v3d_job_cleanup((void *)job); in v3d_submit_tfu_ioctl()
925 struct v3d_csd_job *job = NULL; in v3d_submit_csd_ioctl() local
953 ret = v3d_job_init(v3d, file_priv, (void *)&job, sizeof(*job), in v3d_submit_csd_ioctl()
963 job->args = *args; in v3d_submit_csd_ioctl()
975 job->base.perfmon = v3d_perfmon_find(v3d_priv, in v3d_submit_csd_ioctl()
977 if (!job->base.perfmon) { in v3d_submit_csd_ioctl()
984 v3d_push_job(&job->base); in v3d_submit_csd_ioctl()
987 dma_fence_get(job->base.done_fence)); in v3d_submit_csd_ioctl()
1001 v3d_job_put(&job->base); in v3d_submit_csd_ioctl()
1012 v3d_job_cleanup((void *)job); in v3d_submit_csd_ioctl()