i915_gem_obj...ad_from_page(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

✨ 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, iykyk
  • dst β€” 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 obj is synced with respect to any related writes ✍️

It's giving "I'll do the read, you do the setup" energy. Teamwork, periodt.


πŸ”₯ RETURN πŸ”₯

  • 0 on success β€” slayed πŸ’…βœ¨
  • -ENODEV if the type of obj'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 πŸ‘‘:


πŸ’œ okay that's the whole page, bestie! this one came from ./drivers/gpu/drm/i915/gem, dated October 2026, and yes it's the i915_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