i915_gem_obj...ad_from_page(9)
β¨ NAME β¨
i915_gem_object_read_from_page β aka the "read data from the page of a GEM object" girlie π
okay so real quick, before we even start: this is from the Kernel API Manual (section 9, kernel devs only, no normies allowed π). Bookmark it, bestie.
πΈ SYNOPSIS πΈ
int i915_gem_object_read_from_page (struct drm_i915_gem_object *obj ,
u64 offset , void *dst , int size );
like, that's the whole vibe check right there β¨
π¦ ARGUMENTS π¦
objβ the GEM object we're reading from. our main character fr πoffsetβ where inside the object we're looking. like a lil coordinate, iykykdstβ the buffer where the read data goes to live. it's giving "drop-off spot" πsizeβ how much we're reading. no cap, just how many bytes π«Ά
π DESCRIPTION π
So basically: this reads data from obj at the offset you gave it. Simple, iconic, does what it says on the tin.
BUT β and this is the important part, don't skip it β the region you're reading can't cross a page boundary π Like, ever. That's a hard no. Not me warning you twice.
Also, bestie, you (the caller) gotta handle the prep work, this function is not doing it for you:
- you must ensure that
obj's pages are pinned π - and that
objis synced with respect to any related writes βοΈ
It's giving "I'll do the read, you do the setup" energy. Teamwork, periodt.
π₯ RETURN π₯
0on success β slayed π β¨-ENODEVif the type ofobj's backing store is unsupported β literally the "not my type" error π
π SEE ALSO π
The kernel file lives right here, go be nosy:
./drivers/gpu/drm/i915/gem/i915_gem_object.c
And the whole friend group π:
__i915_gem_object_fini(9)i915_gem_object_set_cache_coherency(9)i915_gem_object_set_pat_index(9)__i915_gem_object_pages_fini(9)i915_gem_object_evictable(9)i915_gem_object_migratable(9)i915_gem_object_has_struct_page(9)i915_gem_object_has_iomem(9)i915_gem_object_can_migrate(9)i915_gem_object_migrate(9)__i915_gem_object_migrate(9)i915_gem_object_placement_possible(9)i915_gem_object_needs_ccs_pages(9)i915_gem_object_get_moving_fence(9)i915_gem_object_wait_moving_fence(9)
π okay that's the whole page, bestie! this one came from./drivers/gpu/drm/i915/gem, dated October 2026, and yes it's thei915_gem_obj...ad_from_page(9)page (the title got truncated with the lil...and honestly? relatable). go read some GEM 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