drm_prime_gem_destroy(9)
π drm_prime_gem_destroy(9) π
okay so bestie, welcome to the Kernel API Manual β yes that's the manual name, we're in kernel-land now, put your hair up π. This page is drm_prime_gem_destroy(9) and honestly? It's the cleanup queen of the PRIME world. She's not glamorous, she's necessary. π«Ά
β¨ NAME β¨
drm_prime_gem_destroy β the helper that cleans up a PRIME-imported GEM object. literally just the "okay we're done here, tidy up bestie" function π
πΈ SYNOPSIS πΈ
void drm_prime_gem_destroy (struct drm_gem_object *obj , struct sg_table *sg );
no cap, that's the whole vibe. returns void, takes two pointers, does the cleanup. periodt.
π¦ ARGUMENTS π¦
objβ the GEM object which was created from a dma-buf. like, this is the baby that got born from an import, and now it's time to say goodbye πsgβ the sg-table which was pinned at import time. yes, pinned. it's been holding on since day one, and now you're releasing it. iconic behavior honestly.
π DESCRIPTION π
so here's the tea β: this is the cleanup function that GEM drivers need to call when they use drm_gem_prime_import or drm_gem_prime_import_dev to import dma-bufs.
that's it. that's the whole description. she's a one-job girlie and she does her job. if you imported it, you gotta call this to clean it up β main character energy, but make it memory management. π₯
fr fr though: GEM drivers need to call this when they use those two import functions. not optional. not a suggestion. it's giving responsibility. π
π₯ SEE ALSO π₯
bestie, the reference list is long and we're not skipping a single one, because every link is a friend of the family π:
- Kernel file
./drivers/gpu/drm/drm_prime.coverview and lifetime rules(9) drm_gem_dmabuf_export(9)drm_gem_dmabuf_release(9)drm_gem_prime_fd_to_handle(9)drm_gem_prime_handle_to_dmabuf(9)drm_gem_prime_handle_to_fd(9)PRIME Helpers(9)drm_gem_map_attach(9)drm_gem_map_detach(9)drm_gem_map_dma_buf(9)drm_gem_unmap_dma_buf(9)drm_gem_dmabuf_vmap(9)drm_gem_dmabuf_vunmap(9)drm_gem_prime_mmap(9)drm_gem_dmabuf_mmap(9)drm_prime_pages_to_sg(9)drm_prime_get_contiguous_size(9)drm_gem_prime_export(9)drm_gem_is_prime_exported_dma_buf(9)drm_gem_prime_import_dev(9)drm_gem_prime_import(9)drm_prime_sg_to_page_array(9)drm_prime_sg_to_dma_addr_array(9)
like, go read all of them. iykyk. π
okay that's the whole page, mwah π β this one lives in ./drivers/gpu/drm and the version/date on the tin says October 2026, so mark your calendars bestie, and go free that memory. slay. β¨π¦π
π¦ 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