Lines Matching full:fence
115 struct pvr_queue_fence *fence = container_of(w, struct pvr_queue_fence, release_work); in pvr_queue_fence_release_work() local
117 pvr_context_put(fence->queue->ctx); in pvr_queue_fence_release_work()
118 dma_fence_free(&fence->base); in pvr_queue_fence_release_work()
123 struct pvr_queue_fence *fence = container_of(f, struct pvr_queue_fence, base); in pvr_queue_fence_release() local
124 struct pvr_device *pvr_dev = fence->queue->ctx->pvr_dev; in pvr_queue_fence_release()
126 queue_work(pvr_dev->sched_wq, &fence->release_work); in pvr_queue_fence_release()
132 struct pvr_queue_fence *fence = container_of(f, struct pvr_queue_fence, base); in pvr_queue_job_fence_get_timeline_name() local
134 switch (fence->queue->type) { in pvr_queue_job_fence_get_timeline_name()
155 struct pvr_queue_fence *fence = container_of(f, struct pvr_queue_fence, base); in pvr_queue_cccb_fence_get_timeline_name() local
157 switch (fence->queue->type) { in pvr_queue_cccb_fence_get_timeline_name()
193 * Currently the only dma_fence backed by a UFO object is the job fence, in pvr_queue_fence_is_ufo_backed()
200 * to_pvr_queue_job_fence() - Return a pvr_queue_fence object if the fence is
205 * - a job fence directly, in which case it simply returns the containing pvr_queue_fence;
206 * - a drm_sched_fence's scheduled or finished fence, in which case it will first try to follow
207 * the parent pointer to find the job fence (note that the parent pointer is initialized
254 /* If the fence hasn't been initialized yet, free the object directly. */ in pvr_queue_fence_put()
262 * pvr_queue_fence_alloc() - Allocate a pvr_queue_fence fence object
276 struct pvr_queue_fence *fence; in pvr_queue_fence_alloc() local
278 fence = kzalloc_obj(*fence); in pvr_queue_fence_alloc()
279 if (!fence) in pvr_queue_fence_alloc()
282 return &fence->base; in pvr_queue_fence_alloc()
287 * @f: The fence to initialize
288 * @queue: The queue this fence belongs to.
289 * @fence_ops: The fence operations.
290 * @fence_ctx: The fence context.
301 struct pvr_queue_fence *fence = container_of(f, struct pvr_queue_fence, base); in pvr_queue_fence_init() local
304 fence->queue = queue; in pvr_queue_fence_init()
305 INIT_WORK(&fence->release_work, pvr_queue_fence_release_work); in pvr_queue_fence_init()
306 dma_fence_init(&fence->base, fence_ops, in pvr_queue_fence_init()
312 * pvr_queue_cccb_fence_init() - Initializes a CCCB fence object.
313 * @fence: The fence to initialize.
314 * @queue: The queue this fence belongs to.
316 * Initializes a fence that can be used to wait for CCCB space.
318 * Should be called in the ::prepare_job() path, so the fence returned to
322 pvr_queue_cccb_fence_init(struct dma_fence *fence, struct pvr_queue *queue) in pvr_queue_cccb_fence_init() argument
324 pvr_queue_fence_init(fence, queue, &pvr_queue_cccb_fence_ops, in pvr_queue_cccb_fence_init()
329 * pvr_queue_job_fence_init() - Initializes a job done fence object.
330 * @fence: The fence to initialize.
331 * @queue: The queue this fence belongs to.
333 * Initializes a fence that will be signaled when the GPU is done executing
336 * Should be called *before* the ::run_job() path, so the fence is initialised
340 pvr_queue_job_fence_init(struct dma_fence *fence, struct pvr_queue *queue) in pvr_queue_job_fence_init() argument
342 if (!fence->ops) in pvr_queue_job_fence_init()
343 pvr_queue_fence_init(fence, queue, &pvr_queue_job_fence_ops, in pvr_queue_job_fence_init()
348 * pvr_queue_fence_ctx_init() - Queue fence context initialization.
379 * One UFO command per native fence this job will be waiting on (unless any are in job_cmds_size()
381 * plus one UFO command for the fence signaling. in job_cmds_size()
389 is_paired_job_fence(struct dma_fence *fence, struct pvr_job *job) in is_paired_job_fence() argument
391 /* This assumes "fence" is one of "job"'s drm_sched_job::dependencies */ in is_paired_job_fence()
394 &job->paired_job->base.s_fence->scheduled == fence; in is_paired_job_fence()
406 struct dma_fence *fence = NULL; in job_count_remaining_native_deps() local
409 xa_for_each(&job->base.dependencies, index, fence) { in job_count_remaining_native_deps()
412 if (is_paired_job_fence(fence, job)) { in job_count_remaining_native_deps()
414 * A fence between paired jobs won't resolve to a pvr_queue_fence (i.e. in job_count_remaining_native_deps()
416 * The submitting code will insert a partial render fence command for this. in job_count_remaining_native_deps()
418 WARN_ON(dma_fence_is_signaled(fence)); in job_count_remaining_native_deps()
423 jfence = to_pvr_queue_job_fence(fence); in job_count_remaining_native_deps()
435 * pvr_queue_get_job_cccb_fence() - Get the CCCB fence attached to a job.
437 * @job: The job to get the CCCB fence on.
439 * The CCCB fence is a synchronization primitive allowing us to delay job
452 /* If the fence is NULL, that means we already checked that we had in pvr_queue_get_job_cccb_fence()
468 /* There should be no job attached to the CCCB fence context: in pvr_queue_get_job_cccb_fence()
476 /* Initialize the fence before returning it. */ in pvr_queue_get_job_cccb_fence()
488 * pvr_queue_get_job_kccb_fence() - Get the KCCB fence attached to a job.
490 * @job: The job to get the KCCB fence on.
492 * The KCCB fence is a synchronization primitive allowing us to delay job
505 /* If the fence is NULL, that means we already checked that we had in pvr_queue_get_job_kccb_fence()
538 * The paired job fence won't be signaled until both jobs have in pvr_queue_get_paired_frag_job_dep()
584 * in the pending list without a valid fence. in pvr_queue_prepare_job()
588 /* CCCB fence is used to make sure we have enough space in the CCCB to in pvr_queue_prepare_job()
593 /* KCCB fence is used to make sure we have a KCCB slot to queue our in pvr_queue_prepare_job()
606 /* The paired job fence should come last, when everything else is ready. */ in pvr_queue_prepare_job()
650 * fence is signaled.
667 struct dma_fence *fence; in pvr_queue_submit_job_to_cccb() local
678 xa_for_each(&job->base.dependencies, index, fence) { in pvr_queue_submit_job_to_cccb()
679 jfence = to_pvr_queue_job_fence(fence); in pvr_queue_submit_job_to_cccb()
701 * a valid parent fence assigned, but the paired job dependency won't have in pvr_queue_submit_job_to_cccb()
702 * one until both jobs have been submitted. Access the parent fence directly in pvr_queue_submit_job_to_cccb()
703 * here instead, submitting it last as partial render fence. in pvr_queue_submit_job_to_cccb()
721 /* Reference value for the partial render test is the current queue fence in pvr_queue_submit_job_to_cccb()
733 /* Update command to signal the job fence. */ in pvr_queue_submit_job_to_cccb()
860 * *%DRM_GPU_SCHED_STAT_NO_HANG if the job fence has already been
945 * @f: Fence to test.
947 * Check if the fence we're being passed is a drm_sched_fence that is coming from this driver.
949 * It may be a UFO-backed fence i.e. a fence that can be signaled or waited upon FW-side,
998 * its CCCB fence, which should kick drm_sched.
1012 /* If we have a job attached to the CCCB fence context, its CCCB fence in pvr_queue_check_job_waiting_for_cccb_space()
1020 /* If we get there, CCCB fence has to be initialized. */ in pvr_queue_check_job_waiting_for_cccb_space()
1028 * If the job fits, signal the CCCB fence, this should unblock in pvr_queue_check_job_waiting_for_cccb_space()
1143 /* Fragment jobs need at least one native fence wait on the geometry job fence. */ in pvr_queue_job_init()
1175 * Initializes fences and return the drm_sched finished fence so it can
1178 * no one grabbed a reference to the returned fence. The latter can happen if
1180 * a job. In that case, we know the fence didn't leave the driver, and we
1181 * can thus guarantee nobody will wait on an dead fence object.
1194 * pvr_queue_job_cleanup() - Cleanup fence/scheduler related fields in the job object.
1225 /* Keep track of the last queued job scheduled fence for combined submit. */ in pvr_queue_job_push()