vmw_cmdbuf_alloc(9)
π vmw_cmdbuf_alloc β kernel API manual, but make it make sense
okay bestie, so this is a page from the Kernel API Manual about vmw_cmdbuf_alloc(9), and it's lowkey iconic because it's the "gimme a buffer" function. let's get into it π
β¨ NAME β¨
vmw_cmdbuf_alloc β allocate a command buffer header, complete with command buffer space. yes, it does both. overachiever behavior π
π¦ SYNOPSIS π¦
void * vmw_cmdbuf_alloc (struct vmw_cmdbuf_man *man , size_t size , bool
interruptible , struct vmw_cmdbuf_header **p_header );
πΈ ARGUMENTS πΈ
manβ the command buffer manager. it's literally the main character here πsizeβ the requested size of the buffer space. how much room you're asking for, fr fr.interruptibleβ whether to sleep interruptible while waiting for space. so like, do you wanna be woken up mid-wait or not π΄p_headerβ points to a header pointer to populate on successful return. it gets filled in for you on the way out, so cute π«Ά
π DESCRIPTION π
so here's the tea: it returns a pointer to command buffer space if it worked. slay. β¨
otherwise? it returns an error pointer. not slay, but honest π
and the header pointer it hands back in p_header? that's the one you should use for the upcoming calls to vmw_cmdbuf_reserve and vmw_cmdbuf_commit. don't lose it, bestie. iykyk π
ngl, remember: success = pointer to buffer space. failure = error pointer. the p_header out-param is your ticket for the next two calls.
π₯ SEE ALSO π₯
the whole friend group, no cap:
- Kernel file
./drivers/gpu/drm/vmwgfx/vmwgfx_cmdbuf.c struct vmw_cmdbuf_context(9)struct vmw_cmdbuf_man(9)struct vmw_cmdbuf_header(9)struct vmw_cmdbuf_dheader(9)struct vmw_cmdbuf_alloc_info(9)vmw_cmdbuf_cur_lock(9)vmw_cmdbuf_cur_unlock(9)vmw_cmdbuf_header_inline_free(9)__vmw_cmdbuf_header_free(9)vmw_cmdbuf_header_free(9)vmw_cmdbuf_header_submit(9)vmw_cmdbuf_ctx_init(9)vmw_cmdbuf_ctx_submit(9)vmw_cmdbuf_ctx_process(9)vmw_cmdbuf_man_process(9)vmw_cmdbuf_ctx_add(9)vmw_cmdbuf_irqthread(9)vmw_cmdbuf_work_func(9)vmw_cmdbuf_man_idle(9)__vmw_cmdbuf_cur_flush(9)vmw_cmdbuf_cur_flush(9)vmw_cmdbuf_idle(9)vmw_cmdbuf_try_alloc(9)vmw_cmdbuf_alloc_space(9)vmw_cmdbuf_space_pool(9)vmw_cmdbuf_space_inline(9)vmw_cmdbuf_reserve_cur(9)vmw_cmdbuf_commit_cur(9)vmw_cmdbuf_reserve(9)vmw_cmdbuf_commit(9)vmw_cmdbuf_send_device_command(9)vmw_cmdbuf_preempt(9)vmw_cmdbuf_startstop(9)vmw_cmdbuf_set_pool_size(9)vmw_cmdbuf_man_create(9)vmw_cmdbuf_remove_pool(9)vmw_cmdbuf_man_destroy(9)
and that's the whole page, periodt π β¨
source/version: ./drivers/gpu/drm/vmwgfx β’ dated October 2026 β shoutout to the driver directory for sponsoring this episode, love u π«Άπ
π¦ 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