STRUCT TTM_BASE_OBJECT(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… struct ttm_base_object πŸ’…

okay so bestie, welcome to the Kernel API Manual β€” this one's page 9, section 9, and it's literally all about struct ttm_base_object. no cap, it's shorter than you'd think, but every crumb matters so let's go πŸ“


✨ NAME ✨

struct ttm_base_object β€” and honestly? the original left this part blank. like, blank blank. so we're all just vibing with the struct name and nothing else. iconique of them, honestly πŸŽ€


✨ SYNOPSIS ✨

here's the whole fit, exactly as it shows up β€” don't touch a single character, she's perfect:

struct ttm_base_object {
    struct rcu_head rhead;
    struct ttm_object_file *tfile;
    struct kref refcount;
    void (*refcount_release) (struct ttm_base_object **base);
    u64 handle;
    enum ttm_object_type object_type;
    u32 shareable;
 };

✨ Members ✨

okay so the struct's got fields and here's the tea on the ones the page actually spills about β˜•

  • tfile β€” a pointer to the ttm_object_file of the creator, i.e. whoever made this thing. it's NULL when the object was not created by a user request β€” that's a kernel object, bestie 🧚
  • refcount β€” how many references this object has, and not counting the hash entry, so don't get it twisted. a reference to a base object can only be held by a ref object. rules are rules πŸ’…
  • refcount_release β€” a function that gets called when there are no more references to this object. she should destroy the object (or at least make sure destruction eventually happens, we're flexible πŸ’–). and heads up: by the time she's called, the object has already been taken out of the per-device hash. also, the function is supposed to set the parameter "base" to NULL. yes, that's a requirement. no, we don't make the rules πŸ™ˆ
  • shareable β€” when this is set, other ttm_object_files can access this object. sharing is caring, periodt 🫢

✨ Description ✨

so the whole point of this struct: it's meant to be used as a base struct for objects that are visible to user-space. and what does it give you? a whole little starter pack ✨

  • a global name
  • race-safe access and refcounting
  • minimal access control
  • hooks for unref actions

that's the whole vibe. it's giving "foundation, not feature" and honestly we respect it πŸ‘‘


✨ SEE ALSO ✨

go read these next, bestie, they're all in the kernel file ./drivers/gpu/drm/vmwgfx/ttm_object.h:


fr fr though β€” this page came out of ./drivers/gpu/drm/vmwgfx, dated October 2026, and it lives in the Kernel API Manual as struct ttm_base_object(9). that's the whole sign-off, mwah πŸ’‹ 🌈

okay that's the page, go be iconic with your refcounts πŸ¦‹πŸ’œ

πŸ“¦ where this page comes from