STRUCT VMW_SW_CONTEXT(9)
π struct vmw_sw_context(9) π
okay bestie, welcome to the <pink>Kernel API Manual</pink> page for struct vmw_sw_context β this is from ./drivers/gpu/drm/vmwgfx, dated October 2026, and no cap, it's a whole command-submission-era moment. pull up a chair π
β¨ NAME β¨
struct vmw_sw_context β literally the Command submission context. that's it. that's the vibe. π¦
πΈ SYNOPSIS πΈ
okay so here's the whole shape of her, every single field, exactly as she is:
struct vmw_sw_context {
unsigned long res_ht[1 << (( VMW_RES_HT_ORDER) - 1)];
bool kernel;
struct vmw_fpriv *fp;
struct drm_file *filp;
uint32_t *cmd_bounce;
uint32_t cmd_bounce_size;
struct vmw_bo *cur_query_bo;
struct list_head bo_relocations;
struct list_head res_relocations;
uint32_t *buf_start;
struct vmw_res_cache_entry res_cache[vmw_res_max];
struct vmw_resource *last_query_ctx;
bool needs_post_query_barrier;
struct vmw_ctx_binding_state *staged_bindings;
bool staged_bindings_inuse;
struct list_head staged_cmd_res;
struct list_head ctx_list;
struct vmw_ctx_validation_info *dx_ctx_node;
struct vmw_bo *dx_query_mob;
struct vmw_resource *dx_query_ctx;
struct vmw_cmdbuf_res_manager *man;
struct vmw_validation_context *ctx;
};
like, she's giving organized chaos and we respect her for it π
π«Ά Members π«Ά
bestie, let's go field by field, no skips, no shortcuts:
res_htβ pointer hash table, used to find validation duplicates. it's literally the "wait, didn't we already do this one?" detector πkernelβ abooltelling you whether the command buffer originated from kernel code rather than from user-space. main character origin story frfpβ ifkernelisfalse, this points to the file of the client. otherwise it'sNULL. iykykfilpβ the DRM state for this file. very "official paperwork" of her πcmd_bounceβ command bounce buffer! used for command validation before copying to fifo space. she bounces, she validates, she slays β¨cmd_bounce_sizeβ the current command bounce buffer size. current! as in it can change! we love a flexible iconcur_query_boβ current buffer object being used as the query result bufferbo_relocationsβ list of buffer object relocations πres_relocationsβ list of resource relocations (yes, a separate list, they're not the same thing, don't @ me)buf_startβ pointer to the start of memory where command validation takes place. the beginning. the origin. the ~pilot episode~res_cacheβ cache of recently looked up resources. memory queen behavior π§last_query_ctxβ the last context that submitted a query. keeping receipts πneeds_post_query_barrierβ whether a query barrier is needed after command submission. abool, a boundary, a whole boundary-issues moment πstaged_bindingsβ cached per-context binding trackerstaged_bindings_inuseβ whether that cached per-context binding tracker is actually in use. tracking the tracker, very meta of her πstaged_cmd_resβ list of staged command buffer managed resources in this command bufferctx_listβ list of context resources referenced in this command bufferdx_ctx_nodeβ validation metadata of the current DX contextdx_query_mobβ the MOB used for DX queriesdx_query_ctxβ the DX context used for the last DX querymanβ pointer to the command buffer managed resource manager. yes his name isman. iconic, no notes π₯ctxβ the validation context. short king. final field. periodt π
π¦ SEE ALSO π¦
the whole friend group, all of them, tagged in the group chat:
Kernel file ./drivers/gpu/drm/vmwgfx/vmwgfx_drv.h, struct vmw_resource(9), struct vmw_surface_metadata(9), struct vmw_surface(9), struct vmw_res_cache_entry(9), enum vmw_dma_map_mode(9), struct vmw_sg_table(9), struct vmw_piter(9), enum vmw_sm_type(9), has_sm4_context(9), has_sm4_1_context(9), has_sm5_context(9), has_gl43_context(9), vmw_resource_mob_attached(9), vmw_fifo_caps(9), vmw_is_cursor_bypass3_enabled(9), vmw_piter_next(9), vmw_piter_dma_addr(9), vmw_piter_page(9), struct vmw_diff_cpy(9), VMW_DEBUG_USER(9), VMW_DEBUG_KMS(9), vmw_fifo_mem_read(9), vmw_fifo_mem_write(9)
like, that's the whole roster and honestly? obsessed π
and that's the page bestie!! π brought to you by ./drivers/gpu/drm/vmwgfx β October 2026, struct vmw_sw_context(9), signing off with a lil kiss π mwah π
π¦ 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