drm_mode_duplicate(9)
π drm_mode_duplicate β allocate and duplicate an existing mode
okay bestie, welcome to the drm_mode_duplicate(9) page from the Kernel API Manual β yes it's a real kernel manpage, no I'm not kidding, and yes it's kinda iconic π
β¨ SYNOPSIS β¨
struct drm_display_mode * drm_mode_duplicate (struct drm_device *dev ,
const struct drm_display_mode *mode );
like, that's the whole function signature, she's not complicated π
πΈ ARGUMENTS πΈ
devβ thedrm_deviceyou're allocating the duplicated mode for π«Ά that's her home nowmodeβ the mode you wanna duplicate. the og. the blueprint. the mother mode π
π¦ DESCRIPTION π¦
so basically: allocate a new mode, copy the existing mode into it, and return a pointer to it. that's it. that's the whole vibe π
it's used to create new instances of established modes β think of it like cloning your fave outfit so you can wear it twice, except it's a struct drm_display_mode and nobody's gonna compliment you at a party for it π
ngl she's lowkey just memcpy with extra steps and a cute name, but she slays and we respect her β¨
β RETURN β
pointer to the duplicated mode on success π NULL on error π (so like, always check. main character energy means checking your return values, periodt)
π SEE ALSO π
the kernel file lives at ./drivers/gpu/drm/drm_modes.c β that's the source, bestie, go read it if you're feeling brave π§
and here's the whole friend group, the entire mode-management squad, no cap π:
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_init(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)
ok that's the whole page, you ate that, go duplicate some modes responsibly ππ
mwah π this gem dropped from the Kernel API Manual, source path ./drivers/gpu/drm, dated October 2026 β see you in the next manpage, bestie πβ¨
π¦ 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