drm_gem_objects_lookup(9)
π drm_gem_objects_lookup(9) π
okay so this is a page straight out of the Kernel API Manual, and bestie, it's a whole function about turning a lil array of user handles into a real array of GEM objects. very main character energy. let's get into it π
β¨ NAME β¨
drm_gem_objects_lookup β look up GEM objects from an array of handles
like, you hand it handles, it hands you objects. that's the vibe. π¦
πΈ SYNOPSIS πΈ
int drm_gem_objects_lookup (struct drm_file *filp , void __user
*bo_handles , int count , struct drm_gem_object ***objs_out );
she takes four things and returns an int. slay. π
π ARGUMENTS π
filpβ the DRM file private date. yes, "date". that's literally what the original says, we're not fixing it, we're respecting it π (if you know you know β iykyk)bo_handlesβ user pointer to an array of userspace handles. like a lil bouquet of handles πcountβ the size of that handle array. how many handles are in the bouquet, essentiallyobjs_outβ the returned pointer to an array ofdrm_gem_objectpointers. this is where she puts the results β¨
π₯ DESCRIPTION π₯
so basically: she takes an array of userspace handles and returns a newly allocated array of GEM objects. brand new. fresh out the box. π
β οΈ after a successful lookup, the GEM objects need to be released usingdrm_gem_object_put, and the array returned inobjs_outmust be freed usingkvfree. do NOT forget this. this is the "please clean up after yourself" part of the group chat π
and if you're only looking up a single handle? don't use this one, bestie β use drm_gem_object_lookup instead. different function for a different situation, periodt. π
β RETURN β
Zero on success, or a negative error code. that's it. that's the tea. π«
π SEE ALSO π
it's giving "citations section of a dissertation". iconic honestly. kernel file ./drivers/gpu/drm/drm_gem.c, plus:
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_object_lookup(9), drm_gem_dma_resv_wait(9), drm_gem_open(9), drm_gem_release(9), drm_gem_object_release(9), drm_gem_object_free(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 whole page!! π this masterpiece lives over at ./drivers/gpu/drm, dated October 2026, and it'll forever be known as drm_gem_objects_lookup(9). go forth and free your kvfrees, bestie π§ββοΈπΈ
π¦ 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