i915_rsgt_f...ddy_resource(9)
β¨ 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β thestruct 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:
- Kernel file
./drivers/gpu/drm/i915/i915_scatterlist.c i915_refct_sgt_init(9)i915_rsgt_from_mm_node(9)
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
- 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