include/drm/drm_suballoc.h
Source file repositories/reference/linux-study-clean/include/drm/drm_suballoc.h
File Facts
- System
- Linux kernel
- Corpus path
include/drm/drm_suballoc.h- Extension
.h- Size
- 2997 bytes
- Lines
- 115
- Domain
- Repository Root And Misc
- Bucket
- include
- Inferred role
- Repository Root And Misc: implementation source
- Status
- source implementation candidate
Why This File Exists
Top-level or miscellaneous repository surface. Use this as map coverage unless a later manual pass promotes the file into a deeper subsystem dossier.
- Top-level or miscellaneous repository surface. Use this as map coverage unless a later manual pass promotes the file into a deeper subsystem dossier.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
drm/drm_mm.hlinux/dma-fence.hlinux/types.h
Detected Declarations
struct drm_suballoc_managerstruct drm_suballocfunction drm_suballoc_soffsetfunction drm_suballoc_eoffsetfunction drm_suballoc_sizefunction drm_suballoc_dump_debug_info
Annotated Snippet
struct drm_suballoc_manager {
wait_queue_head_t wq;
struct list_head *hole;
struct list_head olist;
struct list_head flist[DRM_SUBALLOC_MAX_QUEUES];
size_t size;
size_t align;
};
/**
* struct drm_suballoc - Sub-allocated range
* @olist: List link for list of allocated ranges.
* @flist: List linkk for the manager fenced allocated ranges queues.
* @manager: The drm_suballoc_manager.
* @soffset: Start offset.
* @eoffset: End offset + 1 so that @eoffset - @soffset = size.
* @fence: The fence protecting the allocation.
*/
struct drm_suballoc {
struct list_head olist;
struct list_head flist;
struct drm_suballoc_manager *manager;
size_t soffset;
size_t eoffset;
struct dma_fence *fence;
};
void drm_suballoc_manager_init(struct drm_suballoc_manager *sa_manager,
size_t size, size_t align);
void drm_suballoc_manager_fini(struct drm_suballoc_manager *sa_manager);
struct drm_suballoc *drm_suballoc_alloc(gfp_t gfp);
int drm_suballoc_insert(struct drm_suballoc_manager *sa_manager,
struct drm_suballoc *sa, size_t size, bool intr,
size_t align);
struct drm_suballoc *
drm_suballoc_new(struct drm_suballoc_manager *sa_manager, size_t size,
gfp_t gfp, bool intr, size_t align);
void drm_suballoc_free(struct drm_suballoc *sa, struct dma_fence *fence);
/**
* drm_suballoc_soffset - Range start.
* @sa: The struct drm_suballoc.
*
* Return: The start of the allocated range.
*/
static inline size_t drm_suballoc_soffset(struct drm_suballoc *sa)
{
return sa->soffset;
}
/**
* drm_suballoc_eoffset - Range end.
* @sa: The struct drm_suballoc.
*
* Return: The end of the allocated range + 1.
*/
static inline size_t drm_suballoc_eoffset(struct drm_suballoc *sa)
{
return sa->eoffset;
}
/**
* drm_suballoc_size - Range size.
* @sa: The struct drm_suballoc.
*
* Return: The size of the allocated range.
*/
static inline size_t drm_suballoc_size(struct drm_suballoc *sa)
{
return sa->eoffset - sa->soffset;
}
#ifdef CONFIG_DEBUG_FS
void drm_suballoc_dump_debug_info(struct drm_suballoc_manager *sa_manager,
struct drm_printer *p,
unsigned long long suballoc_base);
#else
static inline void
drm_suballoc_dump_debug_info(struct drm_suballoc_manager *sa_manager,
struct drm_printer *p,
unsigned long long suballoc_base)
{ }
#endif
Annotation
- Immediate include surface: `drm/drm_mm.h`, `linux/dma-fence.h`, `linux/types.h`.
- Detected declarations: `struct drm_suballoc_manager`, `struct drm_suballoc`, `function drm_suballoc_soffset`, `function drm_suballoc_eoffset`, `function drm_suballoc_size`, `function drm_suballoc_dump_debug_info`.
- Atlas domain: Repository Root And Misc / include.
- Implementation status: source implementation candidate.
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.