drm_sched_entity_init(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

✨ 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 in sched_list. gotta know how many we're working with 🧚
  • guilty β€” an atomic_t that gets set to 1 when 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 πŸ’œ


friendly reminder bestie: that atomic_t *guilty gets flipped to 1 when 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