drm_mode_sort(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… drm_mode_sort(9) β€” the Kernel API Manual page, but make it make sense

okay so bestie, this is drm_mode_sort(9) from the Kernel API Manual, and honestly? it's a little one-trick pony but it eats. it does exactly one thing and it does it with main character energy. let's get into it 🫢


✨ NAME ✨

drm_mode_sort β€” sort mode list

like... the whole name is the whole vibe. it sorts a mode list. that's the gig. πŸ’β€β™€οΈ


🌸 SYNOPSIS 🌸

void drm_mode_sort (struct list_head *mode_list );

return type is void, so it doesn't hand anything back to you β€” it just goes in, does the work, and leaves. iconique. no notes. ✨


πŸŽ€ ARGUMENTS πŸŽ€

  • mode_list β€” list of drm_display_mode structures to sort

that's it. one argument. it's a struct list_head * pointing at a pile of drm_display_mode structs, and this function is about to rearrange them. no cap, that's the entire input situation. πŸ¦‹


πŸ’– DESCRIPTION πŸ’–

so here's what happens: it sorts mode_list by favorability, moving good modes to the head of the list.

read that again. favorability. it's literally a vibe check for display modes 😭 β€” the good ones get pushed to the front of the list, and the less-good ones get to chill further back. move over, sorting algorithms, this one's sorting by slay. πŸ’…

and that's the whole description. short and sweet, just like the function. periodt. πŸ”₯

ngl this page is tiny β€” but every little detail still matters, so don't skip the SEE ALSO. it's giving "friend group of 38". πŸ‘‘

🌈 SEE ALSO 🌈

first up, the source file, because you know we're reading the source:

  • Kernel file ./drivers/gpu/drm/drm_modes.c

and now the whole squad, in order, exactly as listed:

thirty-eight links, bestie. thirty-eight. the way this function has more friends than lines of code 😭🫢 iykyk.


okay that's the page!! it lives at ./drivers/gpu/drm, it's dated October 2026, and it's honestly the shortest little baddie in the manual. go forth and sort your modes by favorability, you absolute legend. stay hydrated, read your SEE ALSOs, and remember: good modes go to the head of the list. πŸ’œπŸŒΈβœ¨

πŸ“¦ where this page comes from