Lines Matching refs:job
169 * need to wait for completion before dispatching the job --
173 * synchronously clean after a job.
186 * signaling job completion. So, we synchronously wait before
252 v3d_lock_bo_reservations(struct v3d_job *job,
257 ret = drm_gem_lock_reservations(job->bo, job->bo_count, acquire_ctx);
261 for (i = 0; i < job->bo_count; i++) {
262 ret = dma_resv_reserve_fences(job->bo[i]->resv, 1);
266 ret = drm_sched_job_add_implicit_dependencies(&job->base,
267 job->bo[i], true);
275 drm_gem_unlock_reservations(job->bo, job->bo_count, acquire_ctx);
280 * v3d_lookup_bos() - Sets up job->bo[] with the GEM objects
281 * referenced by the job.
284 * @job: V3D job being set up
289 * the submitted job's BO list. This does the validation of the job's
290 * BO list and reference counting for the lifetime of the job.
298 struct v3d_job *job,
302 job->bo_count = bo_count;
304 if (!job->bo_count) {
314 job->bo_count, &job->bo);
320 struct v3d_job *job = container_of(ref, struct v3d_job, refcount);
323 if (job->bo) {
324 for (i = 0; i < job->bo_count; i++)
325 drm_gem_object_put(job->bo[i]);
326 kvfree(job->bo);
329 dma_fence_put(job->irq_fence);
330 dma_fence_put(job->done_fence);
332 if (job->perfmon)
333 v3d_perfmon_put(job->perfmon);
335 kfree(job);
341 struct v3d_render_job *job = container_of(ref, struct v3d_render_job,
345 list_for_each_entry_safe(bo, save, &job->unref_list, unref_head) {
352 void v3d_job_cleanup(struct v3d_job *job)
354 if (!job)
357 drm_sched_job_cleanup(&job->base);
358 v3d_job_put(job);
361 void v3d_job_put(struct v3d_job *job)
363 kref_put(&job->refcount, job->free);
405 struct v3d_job *job;
411 DRM_ERROR("Cannot allocate memory for v3d job.");
415 job = *container;
416 job->v3d = v3d;
417 job->free = free;
419 ret = drm_sched_job_init(&job->base, &v3d_priv->sched_entity[queue],
436 ret = drm_sched_job_add_syncobj_dependency(&job->base, file_priv, in.handle, 0);
444 ret = drm_sched_job_add_syncobj_dependency(&job->base, file_priv, in_sync, 0);
451 kref_init(&job->refcount);
456 drm_sched_job_cleanup(&job->base);
465 v3d_push_job(struct v3d_job *job)
467 drm_sched_job_arm(&job->base);
469 job->done_fence = dma_fence_get(&job->base.s_fence->finished);
471 /* put by scheduler job completion */
472 kref_get(&job->refcount);
474 drm_sched_entity_push_job(&job->base);
479 struct v3d_job *job,
489 for (i = 0; i < job->bo_count; i++) {
491 dma_resv_add_fence(job->bo[i]->resv, job->done_fence,
495 drm_gem_unlock_reservations(job->bo, job->bo_count, acquire_ctx);
497 /* Update the return sync object for the job */
581 * to be signaled when job completes (out_sync).
649 * v3d_submit_cl_ioctl() - Submits a job (frame) to the V3D.
806 * v3d_submit_tfu_ioctl() - Submits a TFU (texture formatting) job to the V3D.
821 struct v3d_tfu_job *job = NULL;
840 ret = v3d_job_init(v3d, file_priv, (void *)&job, sizeof(*job),
845 job->base.bo = kcalloc(ARRAY_SIZE(args->bo_handles),
846 sizeof(*job->base.bo), GFP_KERNEL);
847 if (!job->base.bo) {
852 job->args = *args;
854 for (job->base.bo_count = 0;
855 job->base.bo_count < ARRAY_SIZE(args->bo_handles);
856 job->base.bo_count++) {
859 if (!args->bo_handles[job->base.bo_count])
862 bo = drm_gem_object_lookup(file_priv, args->bo_handles[job->base.bo_count]);
865 job->base.bo_count,
866 args->bo_handles[job->base.bo_count]);
870 job->base.bo[job->base.bo_count] = bo;
873 ret = v3d_lock_bo_reservations(&job->base, &acquire_ctx);
878 v3d_push_job(&job->base);
882 &job->base, &acquire_ctx,
885 job->base.done_fence);
887 v3d_job_put(&job->base);
892 v3d_job_cleanup((void *)job);
899 * v3d_submit_csd_ioctl() - Submits a CSD (texture formatting) job to the V3D.
915 struct v3d_csd_job *job = NULL;
943 ret = v3d_job_init(v3d, file_priv, (void *)&job, sizeof(*job),
953 job->args = *args;
965 job->base.perfmon = v3d_perfmon_find(v3d_priv,
967 if (!job->base.perfmon) {
974 v3d_push_job(&job->base);
977 dma_fence_get(job->base.done_fence));
991 v3d_job_put(&job->base);
1002 v3d_job_cleanup((void *)job);