drm_gem_object_free(9)
π drm_gem_object_free(9) β a Kernel API Manual moment
okay so bestie, we're in the drm_gem_object_free(9) page from the Kernel API Manual and it is literally the cleanup era of the GEM object's life. short page, huge responsibility. let's get into it π«Ά
β¨ NAME β¨
drm_gem_object_free β free a GEM object. that's it. that's the whole vibe check. the object has lived, it has slayed, and now it's time to go π¦
β¨ SYNOPSIS β¨
void drm_gem_object_free (struct kref *kref );
no cap, that's the whole signature. void in, void out, struct kref * in the middle doing the heavy lifting π₯
β¨ ARGUMENTS β¨
krefβ thekrefof the object you're freeing. bestie this is the reference counter of the object we're saying bye to, so handle it with care π
β¨ DESCRIPTION β¨
so the way this works: this one gets called after the last reference to the object has been lost. like, everybody's left the group chat, the receipts are read, it's over π
and then β it frees the object. that's the whole plot. iconic, concise, done. periodt.
lowkey a reminder that this is the after function. it's what happens when the last reference is gone, not before. don't be out here calling it early, i'm begging π
β¨ SEE ALSO β¨
kernel file ./drivers/gpu/drm/drm_gem.c and honestly a whole friend group of related calls β go read them, they're all main characters:
drm_gem_huge_mnt_create(9)drm_gem_init(9)drm_gem_object_init(9)drm_gem_private_object_init(9)drm_gem_private_object_fini(9)drm_gem_object_handle_get_if_exists_unlocked(9)drm_gem_object_handle_free(9)drm_gem_object_handle_put_unlocked(9)drm_gem_handle_delete(9)drm_gem_dumb_map_offset(9)drm_gem_handle_create_tail(9)drm_gem_handle_create(9)drm_gem_free_mmap_offset(9)drm_gem_create_mmap_offset_size(9)drm_gem_create_mmap_offset(9)drm_gem_get_pages(9)drm_gem_put_pages(9)drm_gem_objects_lookup(9)drm_gem_object_lookup(9)drm_gem_dma_resv_wait(9)drm_gem_open(9)drm_gem_release(9)drm_gem_object_release(9)drm_gem_vm_open(9)drm_gem_vm_close(9)drm_gem_mmap_obj(9)drm_gem_get_unmapped_area(9)drm_gem_mmap(9)drm_gem_lock_reservations(9)drm_gem_lru_init(9)drm_gem_lru_remove(9)drm_gem_lru_move_tail_locked(9)drm_gem_lru_move_tail(9)drm_gem_lru_scan(9)drm_gem_evict_locked(9)
and that's the page, bestie π this lil drop came out of the Kernel API Manual, lives down in ./drivers/gpu/drm, and is dated October 2026 β so yeah, fabulously current. mwah, go free your objects responsibly πΈβ¨
π¦ 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