Lines Matching full:fence

46  * for GPU/CPU synchronization.  When the fence is written,
47 * it is expected that all buffers associated with that fence
92 * amdgpu_fence_write - write a fence value
94 * @ring: ring the fence is associated with
97 * Writes a fence value to memory (all asics).
108 * amdgpu_fence_read - read a fence value
110 * @ring: ring the fence is associated with
112 * Reads a fence value from memory (all asics).
113 * Returns the value of the fence read from memory.
129 * amdgpu_fence_emit - emit a fence on the requested ring
131 * @ring: ring the fence is associated with
132 * @f: resulting fence object
133 * @job: job the fence is embedded in
136 * Emits a fence command on the requested ring (all asics).
143 struct dma_fence *fence; in amdgpu_fence_emit() local
150 /* create a sperate hw fence */ in amdgpu_fence_emit()
154 fence = &am_fence->base; in amdgpu_fence_emit()
157 /* take use of job-embedded fence */ in amdgpu_fence_emit()
158 fence = &job->hw_fence; in amdgpu_fence_emit()
164 fence->seqno = seq; in amdgpu_fence_emit()
165 /* TO be inline with external fence creation and other drivers */ in amdgpu_fence_emit()
166 dma_fence_get(fence); in amdgpu_fence_emit()
169 dma_fence_init(fence, &amdgpu_job_fence_ops, in amdgpu_fence_emit()
173 dma_fence_get(fence); in amdgpu_fence_emit()
175 dma_fence_init(fence, &amdgpu_fence_ops, in amdgpu_fence_emit()
200 to_amdgpu_fence(fence)->start_timestamp = ktime_get(); in amdgpu_fence_emit()
203 * emitting the fence would mess up the hardware ring buffer. in amdgpu_fence_emit()
205 rcu_assign_pointer(*ptr, dma_fence_get(fence)); in amdgpu_fence_emit()
207 *f = fence; in amdgpu_fence_emit()
213 * amdgpu_fence_emit_polling - emit a fence on the requeste ring
215 * @ring: ring the fence is associated with
219 * Emits a fence command on the requested ring (all asics).
220 * Used For polling fence.
261 * amdgpu_fence_process - check for fence activity
265 * Checks the current fence value and calculates the last
266 * signalled fence value. Wakes the fence queue if the
269 * Returns true if fence was processed
294 struct dma_fence *fence, **ptr; in amdgpu_fence_process() local
300 /* There is always exactly one thread signaling this fence slot */ in amdgpu_fence_process()
301 fence = rcu_dereference_protected(*ptr, 1); in amdgpu_fence_process()
304 if (!fence) in amdgpu_fence_process()
307 dma_fence_signal(fence); in amdgpu_fence_process()
308 dma_fence_put(fence); in amdgpu_fence_process()
321 * Checks for fence activity.
329 DRM_WARN("Fence fallback timer expired on ring %s\n", ring->name); in amdgpu_fence_fallback()
335 * @ring: ring index the fence is associated with
343 struct dma_fence *fence, **ptr; in amdgpu_fence_wait_empty() local
351 fence = rcu_dereference(*ptr); in amdgpu_fence_wait_empty()
352 if (!fence || !dma_fence_get_rcu(fence)) { in amdgpu_fence_wait_empty()
358 r = dma_fence_wait(fence, false); in amdgpu_fence_wait_empty()
359 dma_fence_put(fence); in amdgpu_fence_wait_empty()
366 * @ring: ring index the fence is associated with
387 * @ring: ring the fence is associated with
398 * but it's ok to report slightly wrong fence count here. in amdgpu_fence_count_emitted()
407 * amdgpu_fence_last_unsignaled_time_us - the time fence emitted until now
408 * @ring: ring the fence is associated with
410 * Find the earliest fence unsignaled until now, calculate the time delta
411 * between the time fence emitted and now.
416 struct dma_fence *fence; in amdgpu_fence_last_unsignaled_time_us() local
426 fence = drv->fences[last_seq]; in amdgpu_fence_last_unsignaled_time_us()
427 if (!fence) in amdgpu_fence_last_unsignaled_time_us()
431 to_amdgpu_fence(fence)->start_timestamp); in amdgpu_fence_last_unsignaled_time_us()
435 * amdgpu_fence_update_start_timestamp - update the timestamp of the fence
436 * @ring: ring the fence is associated with
437 * @seq: the fence seq number to update.
440 * The function called at the time the fence and related ib is about to
442 * with amdgpu_fence_process to modify the same fence.
447 struct dma_fence *fence; in amdgpu_fence_update_start_timestamp() local
450 fence = drv->fences[seq]; in amdgpu_fence_update_start_timestamp()
451 if (!fence) in amdgpu_fence_update_start_timestamp()
454 to_amdgpu_fence(fence)->start_timestamp = timestamp; in amdgpu_fence_update_start_timestamp()
458 * amdgpu_fence_driver_start_ring - make the fence driver
461 * @ring: ring to start the fence driver on
465 * Make the fence driver ready for processing (all asics).
467 * start the fence driver on the rings it has.
481 /* put fence directly behind firmware */ in amdgpu_fence_driver_start_ring()
492 DRM_DEV_DEBUG(adev->dev, "fence driver on ring %s use gpu addr 0x%016llx\n", in amdgpu_fence_driver_start_ring()
498 * amdgpu_fence_driver_init_ring - init the fence driver
501 * @ring: ring to init the fence driver on
503 * Init the fence driver for the requested ring (all asics).
536 * amdgpu_fence_driver_sw_init - init the fence driver
541 * Init the fence driver for all possible rings (all asics).
543 * start the fence driver on the rings it has using
554 * fence driver interrupts need to be restored.
589 * amdgpu_fence_driver_hw_fini - tear down the fence driver
594 * Tear down the fence driver for all possible rings (all asics).
671 * amdgpu_fence_driver_hw_init - enable the fence driver
676 * Enable the fence driver for all possible rings (all asics).
678 * start the fence driver on the rings it has using
703 * @ring: fence of the ring to be cleared
744 struct dma_fence *fence; in amdgpu_fence_driver_set_error() local
746 fence = rcu_dereference_protected(drv->fences[i], in amdgpu_fence_driver_set_error()
748 if (fence && !dma_fence_is_signaled_locked(fence)) in amdgpu_fence_driver_set_error()
749 dma_fence_set_error(fence, error); in amdgpu_fence_driver_set_error()
755 * amdgpu_fence_driver_force_completion - force signal latest fence of ring
757 * @ring: fence of the ring to signal
768 * Common fence implementation
771 static const char *amdgpu_fence_get_driver_name(struct dma_fence *fence) in amdgpu_fence_get_driver_name() argument
789 * amdgpu_fence_enable_signaling - enable signalling on fence
790 * @f: fence
793 * to fence_queue that checks if this fence is signaled, and if so it
794 * signals the fence and removes itself.
805 * amdgpu_job_fence_enable_signaling - enable signalling on job fence
806 * @f: fence
809 * only handles the job embedded fence.
822 * amdgpu_fence_free - free up the fence memory
826 * Free up the fence memory after the RCU grace period.
832 /* free fence_slab if it's separated fence*/ in amdgpu_fence_free()
837 * amdgpu_job_fence_free - free up the job with embedded fence
841 * Free up the job with embedded fence after the RCU grace period.
847 /* free job if fence has a parent job */ in amdgpu_job_fence_free()
852 * amdgpu_fence_release - callback that fence can be freed
854 * @f: fence
857 * It just RCU schedules freeing up the fence.
865 * amdgpu_job_fence_release - callback that job embedded fence can be freed
867 * @f: fence
870 * only handles the job embedded fence.
892 * Fence debugfs
909 seq_printf(m, "Last signaled fence 0x%08x\n", in amdgpu_debugfs_fence_info_show()
916 seq_printf(m, "Last signaled trailing fence 0x%08x\n", in amdgpu_debugfs_fence_info_show()
941 * Manually trigger a gpu reset at the next fence wait.