|
XenevaOS
|
#include <drm/spsc_queue.h>#include <linux/average.h>#include <linux/dma-fence.h>#include <linux/completion.h>#include <linux/xarray.h>#include <linux/workqueue.h>
Go to the source code of this file.
Classes | |
| struct | drm_sched_entity |
| struct | drm_sched_rq |
| struct | drm_sched_fence |
| struct | drm_sched_job |
| struct | drm_sched_backend_ops |
| struct | drm_gpu_scheduler |
| struct | drm_sched_init_args |
| struct | drm_sched_pending_job_iter |
Macros | |
| #define | MAX_WAIT_SCHED_ENTITY_Q_EMPTY msecs_to_jiffies(1000) |
| #define | DRM_SCHED_FENCE_DONT_PIPELINE DMA_FENCE_FLAG_USER_BITS |
| #define | DRM_SCHED_FENCE_FLAG_HAS_DEADLINE_BIT (DMA_FENCE_FLAG_USER_BITS + 1) |
Functions | |
| DECLARE_EWMA (drm_sched_avgtime, 6, 4) | |
| struct drm_sched_fence * | to_drm_sched_fence (struct dma_fence *f) |
: name (typically the driver's name). Used for debugging | |
struct drm_sched_init_args - parameters for initializing a DRM GPU scheduler @ops: backend operations provided by the driver @submit_wq: workqueue to use for submission. If NULL, an ordered wq is allocated and used. @num_rqs: Number of run-queues. This may be at most DRM_SCHED_PRIORITY_COUNT, as there's usually one run-queue per priority, but may be less. @credit_limit: the number of credits this scheduler can hold from all jobs @hang_limit: number of times to allow a job to hang before dropping it. This mechanism is DEPRECATED. Set it to 0. @timeout: timeout value in jiffies for submitted jobs. @timeout_wq: workqueue to use for timeout work. If NULL, the system_wq is used. @score: score atomic shared with other schedulers. May be NULL. @dev: associated device. Used for debugging | |
| #define | class_drm_sched_pending_job_iter_is_conditional false |
| #define | drm_sched_for_each_pending_job(__job, __sched, __entity) |
| int | drm_sched_init (struct drm_gpu_scheduler *sched, const struct drm_sched_init_args *args) |
| void | drm_sched_fini (struct drm_gpu_scheduler *sched) |
| unsigned long | drm_sched_suspend_timeout (struct drm_gpu_scheduler *sched) |
| void | drm_sched_resume_timeout (struct drm_gpu_scheduler *sched, unsigned long remaining) |
| void | drm_sched_tdr_queue_imm (struct drm_gpu_scheduler *sched) |
| bool | drm_sched_wqueue_ready (struct drm_gpu_scheduler *sched) |
| void | drm_sched_wqueue_stop (struct drm_gpu_scheduler *sched) |
| void | drm_sched_wqueue_start (struct drm_gpu_scheduler *sched) |
| void | drm_sched_stop (struct drm_gpu_scheduler *sched, struct drm_sched_job *bad) |
| void | drm_sched_start (struct drm_gpu_scheduler *sched, int errno) |
| void | drm_sched_resubmit_jobs (struct drm_gpu_scheduler *sched) |
| void | drm_sched_fault (struct drm_gpu_scheduler *sched) |
| bool | drm_sched_is_stopped (struct drm_gpu_scheduler *sched) |
| struct drm_gpu_scheduler * | drm_sched_pick_best (struct drm_gpu_scheduler **sched_list, unsigned int num_sched_list) |
| int | drm_sched_job_init (struct drm_sched_job *job, struct drm_sched_entity *entity, u32 credits, void *owner, u64 drm_client_id) |
| void | drm_sched_job_arm (struct drm_sched_job *job) |
| void | drm_sched_entity_push_job (struct drm_sched_job *sched_job) |
| int | drm_sched_job_add_dependency (struct drm_sched_job *job, struct dma_fence *fence) |
| int | drm_sched_job_add_syncobj_dependency (struct drm_sched_job *job, struct drm_file *file, u32 handle, u32 point) |
| int | drm_sched_job_add_resv_dependencies (struct drm_sched_job *job, struct dma_resv *resv, enum dma_resv_usage usage) |
| int | drm_sched_job_add_implicit_dependencies (struct drm_sched_job *job, struct drm_gem_object *obj, bool write) |
| bool | drm_sched_job_has_dependency (struct drm_sched_job *job, struct dma_fence *fence) |
| void | drm_sched_job_cleanup (struct drm_sched_job *job) |
| void | drm_sched_increase_karma (struct drm_sched_job *bad) |
| bool | drm_sched_job_is_signaled (struct drm_sched_job *job) |
| int | drm_sched_entity_init (struct drm_sched_entity *entity, enum drm_sched_priority priority, struct drm_gpu_scheduler **sched_list, unsigned int num_sched_list, atomic_t *guilty) |
| long | drm_sched_entity_flush (struct drm_sched_entity *entity, long timeout) |
| void | drm_sched_entity_kill (struct drm_sched_entity *entity) |
| void | drm_sched_entity_fini (struct drm_sched_entity *entity) |
| void | drm_sched_entity_destroy (struct drm_sched_entity *entity) |
| void | drm_sched_entity_set_priority (struct drm_sched_entity *entity, enum drm_sched_priority priority) |
| int | drm_sched_entity_error (struct drm_sched_entity *entity) |
| void | drm_sched_entity_modify_sched (struct drm_sched_entity *entity, struct drm_gpu_scheduler **sched_list, unsigned int num_sched_list) |
| DEFINE_CLASS (drm_sched_pending_job_iter, struct drm_sched_pending_job_iter, __drm_sched_pending_job_iter_end(_T), __drm_sched_pending_job_iter_begin(__sched), struct drm_gpu_scheduler *__sched) | |
| #define class_drm_sched_pending_job_iter_is_conditional false |
| #define DRM_SCHED_FENCE_DONT_PIPELINE DMA_FENCE_FLAG_USER_BITS |
DRM_SCHED_FENCE_DONT_PIPELINE - Prevent dependency pipelining
Setting this flag on a scheduler fence prevents pipelining of jobs depending on this fence. In other words we always insert a full CPU round trip before dependent jobs are pushed to the hw queue.
| #define DRM_SCHED_FENCE_FLAG_HAS_DEADLINE_BIT (DMA_FENCE_FLAG_USER_BITS + 1) |
DRM_SCHED_FENCE_FLAG_HAS_DEADLINE_BIT - A fence deadline hint has been set
Because we could have a deadline hint can be set before the backing hw fence is created, we need to keep track of whether a deadline has already been set.
| #define drm_sched_for_each_pending_job | ( | __job, | |
| __sched, | |||
| __entity | |||
| ) |
drm_sched_for_each_pending_job() - Iterator for each pending job in scheduler @__job: Current pending job being iterated over @__sched: DRM scheduler to iterate over pending jobs @__entity: DRM scheduler entity to filter jobs, NULL indicates no filter
Iterator for each pending job in scheduler, filtering on an entity, and enforcing scheduler is fully stopped
| #define MAX_WAIT_SCHED_ENTITY_Q_EMPTY msecs_to_jiffies(1000) |
| enum drm_gpu_sched_stat |
enum drm_gpu_sched_stat - the scheduler's status
@DRM_GPU_SCHED_STAT_NONE: Reserved. Do not use. @DRM_GPU_SCHED_STAT_RESET: The GPU hung and successfully reset. @DRM_GPU_SCHED_STAT_ENODEV: Error: Device is not available anymore. @DRM_GPU_SCHED_STAT_NO_HANG: Contrary to scheduler's assumption, the GPU did not hang and is still running.
| Enumerator | |
|---|---|
| DRM_GPU_SCHED_STAT_NONE | |
| DRM_GPU_SCHED_STAT_RESET | |
| DRM_GPU_SCHED_STAT_ENODEV | |
| DRM_GPU_SCHED_STAT_NO_HANG | |
| enum drm_sched_priority |
| DECLARE_EWMA | ( | drm_sched_avgtime | , |
| 6 | , | ||
| 4 | |||
| ) |
| DEFINE_CLASS | ( | drm_sched_pending_job_iter | , |
| struct drm_sched_pending_job_iter | , | ||
| __drm_sched_pending_job_iter_end(_T) | , | ||
| __drm_sched_pending_job_iter_begin(__sched) | , | ||
| struct drm_gpu_scheduler * | __sched | ||
| ) |
| void drm_sched_entity_destroy | ( | struct drm_sched_entity * | entity | ) |
| int drm_sched_entity_error | ( | struct drm_sched_entity * | entity | ) |
| void drm_sched_entity_fini | ( | struct drm_sched_entity * | entity | ) |
| long drm_sched_entity_flush | ( | struct drm_sched_entity * | entity, |
| long | timeout | ||
| ) |
| int drm_sched_entity_init | ( | struct drm_sched_entity * | entity, |
| enum drm_sched_priority | priority, | ||
| struct drm_gpu_scheduler ** | sched_list, | ||
| unsigned int | num_sched_list, | ||
| atomic_t * | guilty | ||
| ) |
| void drm_sched_entity_kill | ( | struct drm_sched_entity * | entity | ) |
| void drm_sched_entity_modify_sched | ( | struct drm_sched_entity * | entity, |
| struct drm_gpu_scheduler ** | sched_list, | ||
| unsigned int | num_sched_list | ||
| ) |
| void drm_sched_entity_push_job | ( | struct drm_sched_job * | sched_job | ) |
| void drm_sched_entity_set_priority | ( | struct drm_sched_entity * | entity, |
| enum drm_sched_priority | priority | ||
| ) |
| void drm_sched_fault | ( | struct drm_gpu_scheduler * | sched | ) |
| void drm_sched_fini | ( | struct drm_gpu_scheduler * | sched | ) |
| void drm_sched_increase_karma | ( | struct drm_sched_job * | bad | ) |
| int drm_sched_init | ( | struct drm_gpu_scheduler * | sched, |
| const struct drm_sched_init_args * | args | ||
| ) |
| bool drm_sched_is_stopped | ( | struct drm_gpu_scheduler * | sched | ) |
| int drm_sched_job_add_dependency | ( | struct drm_sched_job * | job, |
| struct dma_fence * | fence | ||
| ) |
| int drm_sched_job_add_implicit_dependencies | ( | struct drm_sched_job * | job, |
| struct drm_gem_object * | obj, | ||
| bool | write | ||
| ) |
| int drm_sched_job_add_resv_dependencies | ( | struct drm_sched_job * | job, |
| struct dma_resv * | resv, | ||
| enum dma_resv_usage | usage | ||
| ) |
| int drm_sched_job_add_syncobj_dependency | ( | struct drm_sched_job * | job, |
| struct drm_file * | file, | ||
| u32 | handle, | ||
| u32 | point | ||
| ) |
| void drm_sched_job_arm | ( | struct drm_sched_job * | job | ) |
| void drm_sched_job_cleanup | ( | struct drm_sched_job * | job | ) |
| bool drm_sched_job_has_dependency | ( | struct drm_sched_job * | job, |
| struct dma_fence * | fence | ||
| ) |
| int drm_sched_job_init | ( | struct drm_sched_job * | job, |
| struct drm_sched_entity * | entity, | ||
| u32 | credits, | ||
| void * | owner, | ||
| u64 | drm_client_id | ||
| ) |
| bool drm_sched_job_is_signaled | ( | struct drm_sched_job * | job | ) |
| struct drm_gpu_scheduler * drm_sched_pick_best | ( | struct drm_gpu_scheduler ** | sched_list, |
| unsigned int | num_sched_list | ||
| ) |
| void drm_sched_resubmit_jobs | ( | struct drm_gpu_scheduler * | sched | ) |
| void drm_sched_resume_timeout | ( | struct drm_gpu_scheduler * | sched, |
| unsigned long | remaining | ||
| ) |
| void drm_sched_start | ( | struct drm_gpu_scheduler * | sched, |
| int | errno | ||
| ) |
| void drm_sched_stop | ( | struct drm_gpu_scheduler * | sched, |
| struct drm_sched_job * | bad | ||
| ) |
| unsigned long drm_sched_suspend_timeout | ( | struct drm_gpu_scheduler * | sched | ) |
| void drm_sched_tdr_queue_imm | ( | struct drm_gpu_scheduler * | sched | ) |
| bool drm_sched_wqueue_ready | ( | struct drm_gpu_scheduler * | sched | ) |
| void drm_sched_wqueue_start | ( | struct drm_gpu_scheduler * | sched | ) |
| void drm_sched_wqueue_stop | ( | struct drm_gpu_scheduler * | sched | ) |
| struct drm_sched_fence * to_drm_sched_fence | ( | struct dma_fence * | f | ) |