drm_sched_entity_init(9)
β¨ drm_sched_entity_init β¨
okay bestie, buckle up π
this is a Kernel API Manual page for drm_sched_entity_init(9) and it's literally the glow-up moment for a scheduler entity. Think of it as: you're setting up a whole little identity for your jobs so the scheduler knows where to send them. main character energy fr fr.
π NAME π
drm_sched_entity_init β init a context entity used by the scheduler when you submit to the HW ring. yes that's the whole vibe π¦
πΈ SYNOPSIS πΈ
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 );
like, five arguments, no cap. let's meet them π
π ARGUMENTS π
entityβ the scheduler entity you're initializing. this is the thing getting its whole life together β¨priorityβ the priority of the entity. how important is this babe? very. π₯sched_listβ the list of DRM scheds that jobs from this entity can be submitted to. it's giving "choose your own adventure" πnum_sched_listβ the number of DRM sched entries insched_list. gotta know how many we're working with π§guiltyβ anatomic_tthat gets set to1when a job on this queue is found to be guilty, which causes a timeout. π and yes, that's a real thing, not me being dramatic for once
π¦ DESCRIPTION π¦
okay so important note first, bestie β the sched_list must have at least one element to schedule the entity. like, at least one. don't come at it with an empty list, it will not slay. π
for changing priority later on at runtime, see drm_sched_entity_set_priority. and for changing the set of schedulers sched_list at runtime, see drm_sched_entity_modify_sched. iykyk π
an entity is cleaned up by calling drm_sched_entity_fini. see also drm_sched_entity_destroy if you want the full send π«Ά
Returns 0 on success, or a negative error code on failure. lowkey the most normal return contract ever, we love a clean API πΈ
π SEE ALSO π
- Kernel file
./drivers/gpu/drm/scheduler/sched_entity.cβ the actual source, go read it, it's iconic π drm_sched_entity_stats_release(9)drm_sched_entity_stats_new(9)drm_sched_entity_stats_job_add_gpu_time(9)drm_sched_entity_modify_sched(9)drm_sched_entity_error(9)drm_sched_entity_kill(9)drm_sched_entity_flush(9)drm_sched_entity_fini(9)drm_sched_entity_destroy(9)drm_sched_entity_set_priority(9)drm_sched_entity_push_job(9)
friendly reminder bestie: thatatomic_t *guiltygets flipped to1when a job times out and is found guilty β it's not a toy, it's the timeout shame counter π handle with care.
and that's the whole page, periodt π
this lil cutie lives over in ./drivers/gpu/drm/scheduler, dated October 2026 β so go forth, init your entities, and remember: at least one element in sched_list, always. mwah ππ
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms