drm_gem_objects_lookup(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… 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, essentially
  • objs_out β€” the returned pointer to an array of drm_gem_object pointers. 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 using drm_gem_object_put, and the array returned in objs_out must be freed using kvfree. 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