drivers/gpu/drm/omapdrm/tcm.h
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/omapdrm/tcm.h
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/omapdrm/tcm.h- Extension
.h- Size
- 10231 bytes
- Lines
- 331
- 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.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
- No C-style include directives detected by the generator.
Detected Declarations
struct tcmstruct tcm_ptstruct tcm_areastruct tcmfunction tcm_deinitfunction tcm_reserve_2dfunction tcm_reserve_1dfunction tcm_freefunction tcm_slicefunction tcm_area_is_validfunction __tcm_is_infunction __tcm_area_widthfunction __tcm_area_heightfunction __tcm_sizeoffunction tcm_1d_limit
Annotated Snippet
struct tcm_pt {
u16 x;
u16 y;
};
/* 1d or 2d area */
struct tcm_area {
bool is2d; /* whether area is 1d or 2d */
struct tcm *tcm; /* parent */
struct tcm_pt p0;
struct tcm_pt p1;
};
struct tcm {
u16 width, height; /* container dimensions */
int lut_id; /* Lookup table identifier */
unsigned int y_offset; /* offset to use for y coordinates */
spinlock_t lock;
unsigned long *bitmap;
size_t map_size;
/* function table */
s32 (*reserve_2d)(struct tcm *tcm, u16 height, u16 width, u16 align,
s16 offset, u16 slot_bytes,
struct tcm_area *area);
s32 (*reserve_1d)(struct tcm *tcm, u32 slots, struct tcm_area *area);
s32 (*free)(struct tcm *tcm, struct tcm_area *area);
void (*deinit)(struct tcm *tcm);
};
/*=============================================================================
BASIC TILER CONTAINER MANAGER INTERFACE
=============================================================================*/
/*
* NOTE:
*
* Since some basic parameter checking is done outside the TCM algorithms,
* TCM implementation do NOT have to check the following:
*
* area pointer is NULL
* width and height fits within container
* number of pages is more than the size of the container
*
*/
struct tcm *sita_init(u16 width, u16 height);
/**
* Deinitialize tiler container manager.
*
* @param tcm Pointer to container manager.
*
* @return 0 on success, non-0 error value on error. The call
* should free as much memory as possible and meaningful
* even on failure. Some error codes: -ENODEV: invalid
* manager.
*/
static inline void tcm_deinit(struct tcm *tcm)
{
if (tcm)
tcm->deinit(tcm);
}
/**
* Reserves a 2D area in the container.
*
* @param tcm Pointer to container manager.
* @param height Height(in pages) of area to be reserved.
* @param width Width(in pages) of area to be reserved.
* @param align Alignment requirement for top-left corner of area. Not
* all values may be supported by the container manager,
* but it must support 0 (1), 32 and 64.
* 0 value is equivalent to 1.
* @param offset Offset requirement, in bytes. This is the offset
* from a 4KiB aligned virtual address.
* @param slot_bytes Width of slot in bytes
* @param area Pointer to where the reserved area should be stored.
*
* @return 0 on success. Non-0 error code on failure. Also,
* the tcm field of the area will be set to NULL on
* failure. Some error codes: -ENODEV: invalid manager,
* -EINVAL: invalid area, -ENOMEM: not enough space for
* allocation.
*/
static inline s32 tcm_reserve_2d(struct tcm *tcm, u16 width, u16 height,
u16 align, s16 offset, u16 slot_bytes,
Annotation
- Detected declarations: `struct tcm`, `struct tcm_pt`, `struct tcm_area`, `struct tcm`, `function tcm_deinit`, `function tcm_reserve_2d`, `function tcm_reserve_1d`, `function tcm_free`, `function tcm_slice`, `function tcm_area_is_valid`.
- Atlas domain: Driver Families / drivers/gpu.
- 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.