STRUCT VMW_RESOURCE(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… 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 by dev_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 a guest_memory_offset different 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 by dev_priv::resource_lock.
  • binding_head β€” List head for the context binding list. Protected by the dev_priv::binding_mutex
  • dirty β€” 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:

πŸ’– that's a wrap, bestie! source: ./drivers/gpu/drm/vmwgfx β€’ date: October 2026 β€’ page: struct vmw_resource(9) 🫢
πŸ“¦ where this page comes from