drm_mm_scan_init(9)
π 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β thedrm_mmyou'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. alsou64. keep your stuff lined up, periodt βcolorβ an opaque tag value to use for the allocation. it'sunsigned longand 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:
enum drm_mm_insert_mode(9)struct drm_mm_node(9)struct drm_mm(9)struct drm_mm_scan(9)drm_mm_node_allocated(9)drm_mm_initialized(9)drm_mm_hole_follows(9)drm_mm_hole_node_start(9)drm_mm_hole_node_end(9)drm_mm_nodes(9)drm_mm_for_each_node(9)drm_mm_for_each_node_safe(9)drm_mm_for_each_hole(9)drm_mm_insert_node_generic(9)drm_mm_insert_node(9)drm_mm_clean(9)drm_mm_for_each_node_in_range(9)
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
- 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