drm_mode_init(9)
β¨ drm_mode_init β¨
okay so bestie, welcome to the Kernel API Manual π β this is drm_mode_init(9), and honestly it's giving "small function, big responsibilities." Let me break it down for you π«Ά
πΈ NAME πΈ
drm_mode_init β initialize the mode from another mode π
β SYNOPSIS β
void drm_mode_init (struct drm_display_mode *dst , const struct
struct drm_display_mode *src );
wait, hold up π β I kept that exactly as the page has it, line break and all. So yes, theconst structsits on its own line and thenstruct drm_display_mode *srcfollows. That's the original, no cap. Don't come for me, I just work here π
π ARGUMENTS π
dstβ the mode you're gonna overwrite π (she's the destination, she's about to get a whole new personality)srcβ the mode you're copying from π (the source of truth, the blueprint, the moment)
π DESCRIPTION π
So what does she actually do? She copies an existing mode into another mode β and here's the icon part β¨: she zeroes the list head of the destination mode.
Why does that matter?? Because if you're working with on-stack modes, that list head could literally be sitting there full of stack garbage π and nobody wants that. So drm_mode_init is typically used to guarantee the list head isn't left holding random stack junk.
it's giving "tiny function, huge peace of mind" fr fr π§
π¦ SEE ALSO π¦
First things first, the kernel file lives here:
./drivers/gpu/drm/drm_modes.c
and now, the whole friend group π β every single one of these, no skips:
drm_mode_debug_printmodeline(9)drm_mode_create(9)drm_mode_destroy(9)drm_mode_probed_add(9)drm_analog_tv_mode(9)drm_cvt_mode(9)drm_gtf_mode_complex(9)drm_gtf_mode(9)drm_display_mode_from_videomode(9)drm_display_mode_to_videomode(9)drm_bus_flags_from_videomode(9)of_get_drm_display_mode(9)of_get_drm_panel_display_mode(9)drm_mode_set_name(9)drm_mode_vrefresh(9)drm_mode_get_hv_timing(9)drm_mode_set_crtcinfo(9)drm_mode_copy(9)drm_mode_duplicate(9)drm_mode_match(9)drm_mode_equal(9)drm_mode_equal_no_clocks(9)drm_mode_equal_no_clocks_no_stereo(9)drm_mode_validate_driver(9)drm_mode_validate_size(9)drm_mode_validate_ycbcr420(9)drm_mode_prune_invalid(9)drm_mode_compare(9)drm_mode_sort(9)drm_connector_list_update(9)drm_mode_parse_command_line_for_connector(9)drm_mode_create_from_cmdline_mode(9)drm_mode_convert_to_umode(9)drm_mode_convert_umode(9)drm_mode_is_420_only(9)drm_mode_is_420_also(9)drm_mode_is_420(9)drm_set_preferred_mode(9)
like... that's the entire extended universe π and they all showed up. periodt π
okay that's the whole page, bestie π β go forth and don't leave your list heads full of stack garbage. and one last lil sign-off: this one comes from the source spot ./drivers/gpu/drm and it's dated October 2026 πΈ see u in the next manpage πβ¨
π¦ 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