of_get_videomode(9)
β¨ 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 yourdisplay_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 ofdisplay_timingsπ set it toOF_USE_NATIVE_MODEand 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
- 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