i915_gem_object_lookup_rcu(9)
π i915_gem_object_lookup_rcu β from the Kernel API Manual, bestie β¨
Okay so picture this: you're deep in the i915 driver, you got a handle, and you need the actual GEM object, like, right now, with zero blocking. That's this function. It's giving "grab and go" energy. π
β¨ NAME β¨
i915_gem_object_lookup_rcu β look up a temporary GEM object from its handle. Temporary!! Like a situationship. Do not get attached. π
πΈ SYNOPSIS πΈ
struct drm_i915_gem_object * i915_gem_object_lookup_rcu (struct drm_file
*file , u32 handle );
Look at her. One file, one handle, one pointer to a struct drm_i915_gem_object. Clean. Iconic. No notes. π
π¦ ARGUMENTS π¦
fileβ the DRM file's private date. (Yes, "date." That's literally what the docs say. We don't ask questions, we just pass the right pointer. π)handleβ the userspace handle, i.e. the lil number the app handed you, which you now gotta turn into a real object. Slay.
π₯ RETURN π₯
A pointer to the object named by the handle if such exists on filp, and NULL otherwise. Simple enough, right?
But bestie. Listen to me. Read the fine print. π This object is only valid whilst you're under the RCU read lock β like, only while you're holding it β and note carefully: the object may be in the process of being destroyed. As in, actively being torn down while you're looking at it. π So it's not a "keep her forever" situation, it's a "look, don't touch, and definitely don't hold on past the lock" situation. Respect the lock or get wrecked, no cap.
π SEE ALSO π
Kernel file ./drivers/gpu/drm/i915/gem/i915_gem_object.h β go read the header, it's right there:
__i915_gem_object_page_iter_get_sg(9)i915_gem_object_page_iter_get_sg(9)__i915_gem_object_get_sg(9)i915_gem_object_get_sg(9)__i915_gem_object_get_sg_dma(9)i915_gem_object_get_sg_dma(9)__i915_gem_object_get_page(9)i915_gem_object_get_page(9)__i915_gem_object_get_dirty_page(9)i915_gem_object_get_dirty_page(9)__i915_gem_object_get_dma_address_len(9)i915_gem_object_get_dma_address_len(9)__i915_gem_object_get_dma_address(9)i915_gem_object_get_dma_address(9)i915_gem_object_pin_map(9)i915_gem_object_unpin_map(9)
That's the whole friend group, go say hi. π«Ά
Real talk though: RCU read lock first, object second, always. The order is not negotiable and the destroy-in-progress thing is not a drill. π¨
Okay that's the whole page, mwah. π Signing off from ./drivers/gpu/drm/i915/gem, dated October 2026, and the page you just read is i915_gem_object_lookup_rcu(9) β see you in the kernel, 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