Lines Matching refs:job

167 	 * need to wait for completion before dispatching the job --
171 * synchronously clean after a job.
184 * signaling job completion. So, we synchronously wait before
250 v3d_lock_bo_reservations(struct v3d_job *job,
255 ret = drm_gem_lock_reservations(job->bo, job->bo_count, acquire_ctx);
259 for (i = 0; i < job->bo_count; i++) {
260 ret = drm_gem_fence_array_add_implicit(&job->deps,
261 job->bo[i], true);
263 drm_gem_unlock_reservations(job->bo, job->bo_count,
273 * v3d_lookup_bos() - Sets up job->bo[] with the GEM objects
274 * referenced by the job.
277 * @job: V3D job being set up
280 * the submitted job's BO list. This does the validation of the job's
281 * BO list and reference counting for the lifetime of the job.
289 struct v3d_job *job,
297 job->bo_count = bo_count;
299 if (!job->bo_count) {
307 job->bo = kvmalloc_array(job->bo_count,
310 if (!job->bo) {
315 handles = kvmalloc_array(job->bo_count, sizeof(u32), GFP_KERNEL);
324 job->bo_count * sizeof(u32))) {
331 for (i = 0; i < job->bo_count; i++) {
342 job->bo[i] = bo;
354 struct v3d_job *job = container_of(ref, struct v3d_job, refcount);
359 for (i = 0; i < job->bo_count; i++) {
360 if (job->bo[i])
361 drm_gem_object_put(job->bo[i]);
363 kvfree(job->bo);
365 xa_for_each(&job->deps, index, fence) {
368 xa_destroy(&job->deps);
370 dma_fence_put(job->irq_fence);
371 dma_fence_put(job->done_fence);
373 pm_runtime_mark_last_busy(job->v3d->drm.dev);
374 pm_runtime_put_autosuspend(job->v3d->drm.dev);
376 kfree(job);
382 struct v3d_render_job *job = container_of(ref, struct v3d_render_job,
386 list_for_each_entry_safe(bo, save, &job->unref_list, unref_head) {
393 void v3d_job_put(struct v3d_job *job)
395 kref_put(&job->refcount, job->free);
433 struct v3d_job *job, void (*free)(struct kref *ref),
439 job->v3d = v3d;
440 job->free = free;
446 xa_init_flags(&job->deps, XA_FLAGS_ALLOC);
452 ret = drm_gem_fence_array_add(&job->deps, in_fence);
456 kref_init(&job->refcount);
460 xa_destroy(&job->deps);
467 struct v3d_job *job, enum v3d_queue queue)
471 ret = drm_sched_job_init(&job->base, &v3d_priv->sched_entity[queue],
476 job->done_fence = dma_fence_get(&job->base.s_fence->finished);
478 /* put by scheduler job completion */
479 kref_get(&job->refcount);
481 drm_sched_entity_push_job(&job->base, &v3d_priv->sched_entity[queue]);
488 struct v3d_job *job,
496 for (i = 0; i < job->bo_count; i++) {
498 dma_resv_add_excl_fence(job->bo[i]->resv,
499 job->done_fence);
502 drm_gem_unlock_reservations(job->bo, job->bo_count, acquire_ctx);
504 /* Update the return sync object for the job */
513 * v3d_submit_cl_ioctl() - Submits a job (frame) to the V3D.
670 * v3d_submit_tfu_ioctl() - Submits a TFU (texture formatting) job to the V3D.
685 struct v3d_tfu_job *job;
691 job = kcalloc(1, sizeof(*job), GFP_KERNEL);
692 if (!job)
695 ret = v3d_job_init(v3d, file_priv, &job->base,
698 kfree(job);
702 job->base.bo = kcalloc(ARRAY_SIZE(args->bo_handles),
703 sizeof(*job->base.bo), GFP_KERNEL);
704 if (!job->base.bo) {
705 v3d_job_put(&job->base);
709 job->args = *args;
712 for (job->base.bo_count = 0;
713 job->base.bo_count < ARRAY_SIZE(args->bo_handles);
714 job->base.bo_count++) {
717 if (!args->bo_handles[job->base.bo_count])
721 args->bo_handles[job->base.bo_count]);
724 job->base.bo_count,
725 args->bo_handles[job->base.bo_count]);
731 job->base.bo[job->base.bo_count] = bo;
735 ret = v3d_lock_bo_reservations(&job->base, &acquire_ctx);
740 ret = v3d_push_job(v3d_priv, &job->base, V3D_TFU);
746 &job->base, &acquire_ctx,
748 job->base.done_fence);
750 v3d_job_put(&job->base);
756 drm_gem_unlock_reservations(job->base.bo, job->base.bo_count,
759 v3d_job_put(&job->base);
765 * v3d_submit_csd_ioctl() - Submits a CSD (texture formatting) job to the V3D.
780 struct v3d_csd_job *job;
792 job = kcalloc(1, sizeof(*job), GFP_KERNEL);
793 if (!job)
796 ret = v3d_job_init(v3d, file_priv, &job->base,
799 kfree(job);
805 v3d_job_put(&job->base);
806 kfree(job);
812 v3d_job_put(&job->base);
817 job->args = *args;
829 ret = v3d_push_job(v3d_priv, &job->base, V3D_CSD);
834 dma_fence_get(job->base.done_fence));
849 v3d_job_put(&job->base);
859 v3d_job_put(&job->base);