STRUCT TTM_BASE_OBJECT(9)
π 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 thettm_object_fileof the creator, i.e. whoever made this thing. it'sNULLwhen 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"toNULL. yes, that's a requirement. no, we don't make the rules πshareableβ when this is set, otherttm_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:
enum ttm_object_type(9)struct ttm_prime_object(9)ttm_base_object_init(9)ttm_base_object_lookup(9)ttm_base_object_lookup_for_ref(9)ttm_base_object_unref(9)ttm_ref_object_base_unref(9)ttm_object_file_init(9)ttm_object_file_release(9)ttm_object_device_release(9)
fr fr though β this page came out of./drivers/gpu/drm/vmwgfx, dated October 2026, and it lives in the Kernel API Manual asstruct 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
- 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