vmw_query_bo_switch_commit(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… vmw_query_bo_switch_commit(9) β€” from the Kernel API Manual, bestie ✨

okay so you opened the Kernel API Manual page for vmw_query_bo_switch_commit(9) and you're like "what is this even." sit down, hydrate, and let me tell you about the final step of switching pinned query buffers πŸŽ€


✨ NAME ✨

vmw_query_bo_switch_commit β€” literally the function that finalizes switching a pinned query buffer. that's the whole vibe. πŸ‘‘


🌸 SYNOPSIS 🌸

void vmw_query_bo_switch_commit (struct vmw_private *dev_priv , struct
vmw_sw_context *sw_context );

that's it. that's the signature. void in, void out, no return value to obsess over 🫢


πŸ¦‹ ARGUMENTS πŸ¦‹

  • dev_priv β€” the device private structure. yes queen, the device's own private business πŸ’œ
  • sw_context β€” the software context used for this command submission batch. think of it as the little tote bag this whole batch of commands gets carried around in πŸ‘œ

πŸ’– DESCRIPTION πŸ’–

okay so here's the situation. this function checks if we're switching query buffers β€” and if we are, it goes ahead and issues a dummy occlusion query wait, which is used as a query barrier. iconic behavior honestly.

when the fence object that follows that query wait has signaled, we know for a fact that all the preceding queries have finished β€” so the old query buffer can be unpinned. no cap.

but here's the tasty part: since both the new query buffer and the old one are fenced with that same fence, we can do an asynchronous unpin right now and still be sure the old query buffer won't be moved until the fence has signaled. the way that works is genuinely so satisfying 😭✨

⚠️ as mentioned above, both the new and old query buffers need to be fenced using a sequence emitted after calling this function. like, after after. don't skip this step, bestie πŸ’€

🌈 SEE ALSO 🌈

the full squad, in order, exactly as the manpage rolled them out 🫑 (and yes, Kernel file ./drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c is part of the crew):

struct vmw_relocation(9), enum vmw_resource_relocation_type(9), struct vmw_resource_relocation(9), struct vmw_ctx_validation_info(9), struct vmw_cmd_entry(9), vmw_ptr_diff(9), vmw_execbuf_bindings_commit(9), vmw_bind_dx_query_mob(9), vmw_cmd_ctx_first_setup(9), vmw_execbuf_res_size(9), vmw_execbuf_rcache_update(9), vmw_execbuf_res_val_add(9), vmw_view_res_val_add(9), vmw_view_id_val_add(9), vmw_resource_context_res_add(9), vmw_resource_relocation_add(9), vmw_resource_relocations_free(9), vmw_resource_relocations_apply(9), vmw_resources_reserve(9), vmw_cmd_res_check(9), vmw_rebind_all_dx_query(9), vmw_rebind_contexts(9), vmw_view_bindings_add(9), vmw_cmd_cid_check(9), vmw_execbuf_info_from_res(9), vmw_query_bo_switch_prepare(9), vmw_translate_mob_ptr(9), vmw_translate_guest_ptr(9), vmw_cmd_dx_define_query(9), vmw_cmd_dx_bind_query(9), vmw_cmd_begin_gb_query(9), vmw_cmd_begin_query(9), vmw_cmd_end_gb_query(9), vmw_cmd_end_query(9), vmw_cmd_wait_gb_query(9), vmw_cmd_wait_query(9), vmw_cmd_res_switch_backup(9), vmw_cmd_switch_backup(9), vmw_cmd_bind_gb_surface(9), vmw_cmd_update_gb_image(9), vmw_cmd_update_gb_surface(9), vmw_cmd_readback_gb_image(9), vmw_cmd_readback_gb_surface(9), vmw_cmd_invalidate_gb_image(9), vmw_cmd_invalidate_gb_surface(9), vmw_cmd_shader_define(9), vmw_cmd_shader_destroy(9), vmw_cmd_set_shader(9), vmw_cmd_set_shader_const(9), vmw_cmd_bind_gb_shader(9), vmw_cmd_dx_set_single_constant_buffer(9), vmw_cmd_dx_set_constant_buffer_offset(9), vmw_cmd_dx_set_shader_res(9), vmw_cmd_dx_set_shader(9), vmw_cmd_dx_set_vertex_buffers(9), vmw_cmd_dx_set_index_buffer(9), vmw_cmd_dx_set_rendertargets(9), vmw_cmd_dx_clear_rendertarget_view(9), vmw_cmd_dx_clear_depthstencil_view(9), vmw_cmd_dx_set_so_targets(9), vmw_cmd_dx_check_subresource(9), vmw_cmd_dx_view_remove(9), vmw_cmd_dx_define_shader(9), vmw_cmd_dx_destroy_shader(9), vmw_cmd_dx_bind_shader(9), vmw_cmd_dx_genmips(9), vmw_cmd_dx_transfer_from_buffer(9), vmw_cmd_intra_surface_copy(9), vmw_execbuf_copy_fence_user(9), vmw_execbuf_submit_fifo(9), vmw_execbuf_submit_cmdbuf(9), vmw_execbuf_cmdbuf(9), vmw_execbuf_unpin_panic(9), __vmw_execbuf_release_pinned_bo(9), vmw_execbuf_release_pinned_bo(9)


and that's the page!! happy reading, go fence your buffers responsibly πŸ’…πŸ¦‹

sign-off time: this one lives in ./drivers/gpu/drm/vmwgfx, it's dated October 2026, and the page itself is vmw_query_bo_switch_commit(9) β€” mwah, take care of her πŸŽ€πŸ’œ

πŸ“¦ where this page comes from