drivers/gpu/drm/i915/i915_scatterlist.h
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/i915/i915_scatterlist.h
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/i915/i915_scatterlist.h- Extension
.h- Size
- 6963 bytes
- Lines
- 241
- Domain
- Driver Families
- Bucket
- drivers/gpu
- Inferred role
- Driver Families: implementation source
- Status
- source implementation candidate
Why This File Exists
Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Touches IRQ or DMA behavior; this matters for the representative real-device path.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/pfn.hlinux/scatterlist.hlinux/dma-mapping.hxen/xen.hi915_gem.h
Detected Declarations
struct drm_mm_nodestruct ttm_resourcestruct i915_refct_sgt_opsstruct i915_refct_sgtfunction __sg_page_countfunction __sg_dma_page_countfunction i915_sg_dma_sizesfunction i915_sg_segment_sizefunction i915_refct_sgt_putfunction i915_refct_sgt_getfunction __i915_refct_sgt_init
Annotated Snippet
struct i915_refct_sgt_ops {
/**
* @release: Free the memory of the struct i915_refct_sgt
*/
void (*release)(struct kref *ref);
};
/**
* struct i915_refct_sgt - A refcounted scatter-gather table
* @kref: struct kref for refcounting
* @table: struct sg_table holding the scatter-gather table itself. Note that
* @table->sgl = NULL can be used to determine whether a scatter-gather table
* is present or not.
* @size: The size in bytes of the underlying memory buffer
* @ops: The operations structure.
*/
struct i915_refct_sgt {
struct kref kref;
struct sg_table table;
size_t size;
const struct i915_refct_sgt_ops *ops;
};
/**
* i915_refct_sgt_put - Put a refcounted sg-table
* @rsgt: the struct i915_refct_sgt to put.
*/
static inline void i915_refct_sgt_put(struct i915_refct_sgt *rsgt)
{
if (rsgt)
kref_put(&rsgt->kref, rsgt->ops->release);
}
/**
* i915_refct_sgt_get - Get a refcounted sg-table
* @rsgt: the struct i915_refct_sgt to get.
*/
static inline struct i915_refct_sgt *
i915_refct_sgt_get(struct i915_refct_sgt *rsgt)
{
kref_get(&rsgt->kref);
return rsgt;
}
/**
* __i915_refct_sgt_init - Initialize a refcounted sg-list with a custom
* operations structure
* @rsgt: The struct i915_refct_sgt to initialize.
* @size: Size in bytes of the underlying memory buffer.
* @ops: A customized operations structure in case the refcounted sg-list
* is embedded into another structure.
*/
static inline void __i915_refct_sgt_init(struct i915_refct_sgt *rsgt,
size_t size,
const struct i915_refct_sgt_ops *ops)
{
kref_init(&rsgt->kref);
rsgt->table.sgl = NULL;
rsgt->size = size;
rsgt->ops = ops;
}
void i915_refct_sgt_init(struct i915_refct_sgt *rsgt, size_t size);
struct i915_refct_sgt *i915_rsgt_from_mm_node(const struct drm_mm_node *node,
u64 region_start,
u32 page_alignment);
struct i915_refct_sgt *i915_rsgt_from_buddy_resource(struct ttm_resource *res,
u64 region_start,
u32 page_alignment);
#endif
Annotation
- Immediate include surface: `linux/pfn.h`, `linux/scatterlist.h`, `linux/dma-mapping.h`, `xen/xen.h`, `i915_gem.h`.
- Detected declarations: `struct drm_mm_node`, `struct ttm_resource`, `struct i915_refct_sgt_ops`, `struct i915_refct_sgt`, `function __sg_page_count`, `function __sg_dma_page_count`, `function i915_sg_dma_sizes`, `function i915_sg_segment_size`, `function i915_refct_sgt_put`, `function i915_refct_sgt_get`.
- Atlas domain: Driver Families / drivers/gpu.
- Implementation status: source implementation candidate.
- IRQ or DMA behavior appears here, which is relevant to the selected PCIe/NVMe device path.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.