drm_vram_helper_mode_valid(9)
π 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:
- Kernel file
./drivers/gpu/drm/drm_gem_vram_helper.coverview(9) drm_gem_vram_create(9)drm_gem_vram_put(9)drm_gem_vram_offset(9)drm_gem_vram_vmap(9)drm_gem_vram_vunmap(9)drm_gem_vram_fill_create_dumb(9)drm_gem_vram_object_free(9)drm_gem_vram_driver_dumb_create(9)drm_gem_vram_plane_helper_prepare_fb(9)drm_gem_vram_plane_helper_cleanup_fb(9)drm_gem_vram_object_vmap(9)drm_gem_vram_object_vunmap(9)drm_vram_mm_debugfs_init(9)drmm_vram_helper_init(9)
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
- 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