drm_mm_scan_init(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… drm_mm_scan_init(9) β€” Kernel API Manual πŸŽ€

okay bestie, this one's a little C function from the kernel API manual and it's genuinely not scary, i promise. it's called drm_mm_scan_init, and it's lowkey just the "set up your scan" starter pack. let's get into it ✨


🌸 NAME 🌸

drm_mm_scan_init β€” initialize lru scanning. that's it, that's the whole name. short, sweet, iconic πŸ‘‘


✨ SYNOPSIS ✨

void drm_mm_scan_init (struct drm_mm_scan *scan , struct drm_mm *mm ,
u64 size , u64 alignment , unsigned long color , enum drm_mm_insert_mode
mode );

like, look at her. void return, six arguments, zero drama. copy it exactly, don't be cute with it 🫢


πŸ¦‹ ARGUMENTS πŸ¦‹

  • scan β€” the scan state. this is the little buddy you're setting up, so hand it over and let the function do its thing πŸ’–
  • mm β€” the drm_mm you're scanning. the whole memory-manager situation you're poking at.
  • size β€” size of the allocation. yes, u64. yes, big girl numbers 🌈
  • alignment β€” alignment of the allocation. also u64. keep your stuff lined up, periodt ⭐
  • color β€” an opaque tag value to use for the allocation. it's unsigned long and it's opaque, meaning it's a vibe, not a thing you interpret. iykyk πŸ’…
  • mode β€” enum drm_mm_insert_mode. this one fine-tunes the allocation search and the placement. main character energy honestly πŸ‘‘

πŸ”₯ DESCRIPTION πŸ”₯

so here's the tea: this is a simplified version of drm_mm_scan_init_with_range, and the simplification is that there are no range restrictions applied. that's the whole diff. no range bestie, we're free πŸ’€

it literally just sets up the scanning routines with the parameters for the desired hole. that's the entire job. it's giving "setup function" and honestly? she ate. no cap. ✨

⚠️ Warning: as long as the scan list is non-empty, no other operations than adding/removing nodes to/from the scan list are allowed. like... none. zero. do not pass go, do not do other stuff, just add and remove nodes. this is not a drill 😭 seriously, don't get weird with it or things go bad.

🧚 SEE ALSO 🧚

Kernel file ./include/drm/drm_mm.h β€” and the whole friend group:


and that's the whole page, bestie πŸ’œ it lives under ./include/drm, dated October 2026. go forth and initialize your lru scanning responsibly, mwah πŸ“πŸ«Ά

πŸ“¦ where this page comes from