i915_rsgt_f...ddy_resource(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

✨ i915_rsgt_from_buddy_resource ✨

okay so this is a page from the Kernel API Manual (yes, the actual kernel docs, we're literally in the big leagues now bestie πŸ’…) and it's all about one little function that turns a buddy-block list into a refcounted sg_table. stay with me, it's gonna slay 🫢


🌸 NAME 🌸

i915_rsgt_from_buddy_resource β€” create a refcounted sg_table from a struct i915_buddy_block list. that's the whole vibe. no cap. ✨


πŸŽ€ SYNOPSIS πŸŽ€

struct i915_refct_sgt * i915_rsgt_from_buddy_resource (struct ttm_resource *res , u64 region_start , u32 page_alignment );

like, look at her. three params, one pointer back. iconic behavior honestly πŸ‘‘


πŸ’– ARGUMENTS πŸ’–

  • res β€” the struct i915_ttm_buddy_resource. this is the main character of the operation, the thing you're actually converting. πŸ’«
  • region_start β€” an offset that gets added to the dma addresses of the sg list. think of it as the little shove that puts everything in the right place 🫢
  • page_alignment β€” the required page alignment for each sg entry. and listen: it's gotta be a power of two. not vibes-based, actual math. no exceptions bestie 😭

πŸ¦‹ DESCRIPTION πŸ¦‹

so what she does is create a struct sg_table, and she initializes it from a struct i915_buddy_block list. but here's the detail that ate: she takes a maximum segment length into account, and splits into segments if necessary. so if your list is doing too much, she breaks it up. she's organized like that. πŸ’…


πŸ”₯ RETURN πŸ”₯

on success you get a pointer to a kmalloced struct i915_refct_sgts. and on failure? a negative error code cast to an error pointer. so like, check it with IS_ERR() and don't just start dereferencing, i'm begging πŸ™ˆ


🌈 SEE ALSO 🌈

bestie go read the source, it's right here:


and that's the page!! πŸ’œ this whole thing lives in ./drivers/gpu/drm/i915 and it's dated October 2026, filed under the Kernel API Manual, page i915_rsgt_f...ddy_resource(9) β€” yes the title is truncated in the header, that's just how it is, we don't question the formatting gods 😭✨ mwah, go read your scatterlists bestie πŸ“

πŸ“¦ where this page comes from