STRUCT VMW_SW_CONTEXT(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– 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 β€” a bool telling you whether the command buffer originated from kernel code rather than from user-space. main character origin story fr
  • fp β€” if kernel is false, this points to the file of the client. otherwise it's NULL. iykyk
  • filp β€” 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 icon
  • cur_query_bo β€” current buffer object being used as the query result buffer
  • bo_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. a bool, a boundary, a whole boundary-issues moment 😭
  • staged_bindings β€” cached per-context binding tracker
  • staged_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 buffer
  • ctx_list β€” list of context resources referenced in this command buffer
  • dx_ctx_node β€” validation metadata of the current DX context
  • dx_query_mob β€” the MOB used for DX queries
  • dx_query_ctx β€” the DX context used for the last DX query
  • man β€” pointer to the command buffer managed resource manager. yes his name is man. 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