of_get_videomode(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

✨ of_get_videomode(9) ✨

okay so bestie, welcome to the Kernel API Manual πŸ’– this one's a little function from the kernel's device-tree video corner and it's honestly so useful, let's get into it πŸŽ€


🌸 NAME 🌸

of_get_videomode β€” grab videomode #<index> straight out of the devicetree, periodt πŸ’…


πŸ¦‹ SYNOPSIS πŸ¦‹

int of_get_videomode (struct device_node *np , struct videomode *vm ,
int index );

🌈 ARGUMENTS 🌈

  • np β€” the devicenode that's holding your display_timings, like that's the whole vibe check right there 🫢
  • vm β€” gets set to the return value, so this is where your answer lands ✨
  • index β€” which one you want from the list of display_timings πŸ‘‘ set it to OF_USE_NATIVE_MODE and you'll get whatever mode the DT says is the native mode, iconic behaviour fr fr

🧚 DESCRIPTION 🧚

So what this does is: it gets a list of all the display timings, and then it puts the one you asked for by index into *vm. Literally just that 😭

But listen β€” this function should only be used if you're retrieving exactly one videomode. That's the whole point. If your driver needs to work with multiple videomodes (or like, all of them, main character energy), then you don't use this one β€” you work with of_get_display_timings instead. slay πŸ’…

ngl, this is the "just one pls" function. don't try to make it do the multi-mode thing, that's not its moment πŸ’€

⭐ SEE ALSO ⭐

  • Kernel file ./drivers/video/of_videomode.c β€” go read it, iykyk πŸ”₯

and that's the whole page bestie πŸ“ this little gem lives in ./drivers/video and it's dated October 2026 in the Kernel API Manual β€” no cap, that's the tea πŸ’œβœ¨

πŸ“¦ where this page comes from