drm_vram_helper_mode_valid(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– drm_vram_helper_mode_valid(9) πŸ’–

ok so real talk bestie, this one lives in the Kernel API Manual and it's literally called drm_vram_helper_mode_valid β€” and yes, the whole vibe is "does this display mode's framebuffer actually fit in the video memory we have lying around?" πŸŽ€


✨ NAME ✨

drm_vram_helper_mode_valid β€” tests if a display mode's framebuffer fits into the available video memory. that's it, that's the whole job, and it does it slayfully πŸ’…


🌸 SYNOPSIS 🌸

enum drm_mode_status drm_vram_helper_mode_valid (struct drm_device *dev
, const struct drm_display_mode *mode );

πŸ¦‹ ARGUMENTS πŸ¦‹

  • dev β€” the DRM device. your main character, the whole reason we're here 🫢
  • mode β€” the mode to test. we're putting it through a vibe check, basically.

πŸ’œ DESCRIPTION πŸ’œ

okay so here's the tea β˜• β€” this function tests if there's enough video memory available for using the specified display mode.

Atomic modesetting requires importing the designated framebuffer into video memory before evicting the active one. like, no cutting the line, bestie. and because of that, any framebuffer may consume at most half of the available VRAM. half! that's the rule! βœ‹

so display modes that need a larger framebuffer can not be used β€” even if the CRTC does support them 😭 like sorry, the CRTC said yes but the memory said no.

and each framebuffer is assumed to have 32-bit color depth. that's the assumption, we're rolling with it.


πŸ‘‘ NOTE πŸ‘‘

heads up, this is important, don't skip it πŸ™ˆ

The function can only test if the display mode is supported in general. so if there are too many framebuffers pinned to video memory, a display mode may still not be usable in practice β€” ik, tragic πŸ’€

The color depth of 32-bit fits all current use case, fr fr. A more flexible test can be added when necessary β€” like, future us can handle that, present us is chillin'.


πŸ”₯ RETURN πŸ”₯

MODE_OK if the display mode is supported πŸŽ‰ β€” or an error code of type enum drm_mode_status otherwise πŸ˜”


⭐ SEE ALSO ⭐

go read these next, i promise they're worth it:


okay that's the whole page bestie, you ate that πŸ“ this one came straight out of ./drivers/gpu/drm and it's dated October 2026 β€” no cap, that's the version and the date fr fr, so go forth and check those framebuffers πŸ’–βœ¨πŸ§š

πŸ“¦ where this page comes from