drm_set_preferred_mode(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– drm_set_preferred_mode(9) πŸ’–

okay bestie so we're in the Kernel API Manual today and this one is short but honestly iconic β€” it's the little function that picks a favorite child among your display modes πŸŽ€


✨ NAME ✨

drm_set_preferred_mode β€” sets the preferred mode of a connector πŸ’…


🌸 SYNOPSIS 🌸

void drm_set_preferred_mode (struct drm_connector *connector , int hpref , int vpref );

πŸ¦‹ ARGUMENTS πŸ¦‹

  • connector β€” the connector whose mode list should be processed 🫢 like, this is the one getting the glow-up
  • hpref β€” horizontal resolution of the preferred mode (yes, the width, the horizontal vibe ✨)
  • vpref β€” vertical resolution of the preferred mode (the height, the vertical vibe πŸ’œ)

πŸ‘‘ DESCRIPTION πŸ‘‘

So here's the tea β˜•: this function goes through stuff and marks a mode as preferred if it matches the resolution you specified with hpref and vpref. That's it. That's the whole plot. Short and slay πŸ”₯


🌈 SEE ALSO 🌈

Kernel file ./drivers/gpu/drm/drm_modes.c β€” that's where the magic lives, iykyk 🧚

and the whole friend group of related functions, all here, all accounted for, no cap:


and that's the whole page, bestie β€” go set some preferred modes, you absolute main character πŸ’…βœ¨

sign-off szn πŸŽ€ this one shipped from ./drivers/gpu/drm, dated October 2026, and it's the drm_set_preferred_mode(9) page, mwah πŸ’–

πŸ“¦ where this page comes from