vmw_surface..._buffer_size(9)
π vmw_surface..._buffer_size(9) β from the Kernel API Manual, bestie
okay so picture this: it's a kernel manual page, the title is vmw_surface..._buffer_size(9), and it lives in the Kernel API Manual. that's the vibe. now let's get into it π«Ά
β¨ NAME β¨
vmw_surface_get_image_buffer_size β literally just calculates image buffer size. that's her whole job. π
πΈ SYNOPSIS πΈ
u32 vmw_surface_get_image_buffer_size (const SVGA3dSurfaceDesc *desc ,
const struct drm_vmw_size *size , u32 pitch );
no cap, that's the whole signature. three args, one u32 coming back at you. π¦
π ARGUMENTS π
okay so about these three⦠the page is kinda shy here, ngl:
descβ -- undescribed -- π the manual literally does not describe it. we know her name, we don't know her lore.sizeβ -- undescribed -- same situation. iconic of the docs to leave it at that. πpitchβ -- undescribed -- yes bestie, also undescribed. but stay tuned, becausepitchdoes get screen time in DESCRIPTION. main character energy honestly. π
π₯ DESCRIPTION π₯
so what does she actually do? she returns the number of bytes of buffer space you need to store one image of a surface, optionally using the pitch you specified. that's the whole flex. β
and here's the little detail that matters: if pitch is zero, it's assumed that rows are tightly packed. zero pitch = cozy, no gaps, rows snuggled right up against each other. πΈ
now the part where you listen, because this is the good bit: this function is overflow-safe. if the result would have overflowed, instead of doing something cursed, it just returns MAX_UINT32. periodt. it will not hand you garbage β it hands you the max value and moves on. πβ¨
lowkey important: MAX_UINT32 means "this would've overflowed, bestie" β it's the safe bail-out, not an actual size. don't go allocating that many bytes and blame me. π
π¦ SEE ALSO π¦
the whole friend group, fr fr:
- Kernel file
./drivers/gpu/drm/vmwgfx/vmw_surface_cache.h vmw_surface_get_desc(9)vmw_surface_get_mip_size(9)vmw_surface_get_serialized_size(9)vmw_surface_get_serialized_size_extended(9)vmw_surface_get_pixel_offset(9)vmw_surface_is_gb_screen_target_format(9)vmw_surface_is_dx_screen_target_format(9)vmw_surface_is_screen_target_format(9)struct vmw_surface_mip(9)struct vmw_surface_cache(9)struct vmw_surface_loc(9)vmw_surface_subres(9)vmw_surface_setup_cache(9)vmw_surface_get_loc(9)vmw_surface_inc_loc(9)vmw_surface_min_loc(9)
that's a group chat and a half, and yes they all ate. π
π sign-off π
this little love letter lives in ./drivers/gpu/drm/vmwgfx, dated October 2026 β so mark your calendars, bestie. go forth, compute your buffer sizes, and stay overflow-safe out there. π§π
π¦ 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