STRUCT VMW_RESOURCE(9)
π struct vmw_resource π
okay so bestie, we're in the Kernel API Manual and this page is literally struct vmw_resource(9) β the base class for hardware resources. no cap, it's the blueprint for hardware resource vibes. let's get into it β¨
πΈ NAME πΈ
struct vmw_resource β base class for hardware resources π«Ά
β¨ SYNOPSIS β¨
here's the whole struct, copied exactly because we do not mess with the source, periodt:
struct vmw_resource {
struct kref kref;
struct vmw_private *dev_priv;
int id;
u32 used_prio;
unsigned long guest_memory_size;
u32 res_dirty : 1;
u32 guest_memory_dirty : 1;
u32 coherent : 1;
struct vmw_bo *guest_memory_bo;
unsigned long guest_memory_offset;
unsigned long pin_count;
const struct vmw_res_func *func;
struct rb_node mob_node;
struct list_head lru_head;
struct list_head binding_head;
struct vmw_resource_dirty *dirty;
void (*res_free) (struct vmw_resource *res);
void (*hw_destroy) (struct vmw_resource *res);
};
π Members π
krefβ For refcounting. π§dev_privβ Pointer to the device private for this resource. Immutable.idβ Device id. Protected bydev_priv::resource_lock.used_prioβ Priority for this resource. βguest_memory_sizeβ Guest memory buffer size. Immutable.res_dirtyβ Resource contains data not yet in the guest memory buffer. Protected by resource reserved.guest_memory_dirtyβ Guest memory buffer contains data not yet in the HW resource. Protected by resource reserved.coherentβ Emulate coherency by tracking vm accesses. π¦guest_memory_boβ The guest memory buffer if any. Protected by resource reserved.guest_memory_offsetβ Offset into the guest memory buffer if any. Protected by resource reserved. Note that only a few resource types can have aguest_memory_offsetdifferent from zero. πpin_countβ The pin count for this resource. A pinned resource has a pin-count greater than zero. It is not on the resource LRU lists and its guest memory buffer is pinned. Hence it can't be evicted. π₯funcβ Method vtable for this resource. Immutable.mob_nodeβ Node for the MOB guest memory rbtree. Protected by guest_memory_bo reserved.lru_headβ List head for the LRU list. Protected bydev_priv::resource_lock.binding_headβ List head for the context binding list. Protected by thedev_priv::binding_mutexdirtyβ resource's dirty tracker π«Άres_freeβ The resource destructor.hw_destroyβ Callback to destroy the resource on the device, as part of resource destruction. π
π SEE ALSO π
the kernel file is ./drivers/gpu/drm/vmwgfx/vmwgfx_drv.h β and here's the whole cross-ref squad, iykyk:
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)struct vmw_sw_context(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)
π that's a wrap, bestie! source:./drivers/gpu/drm/vmwgfxβ’ date:October 2026β’ page:struct vmw_resource(9)π«Ά
π¦ 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