drivers/gpu/drm/amd/display/include/vector.h
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/amd/display/include/vector.h
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/amd/display/include/vector.h- Extension
.h- Size
- 4466 bytes
- Lines
- 151
- 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 vector
Annotated Snippet
struct vector {
uint8_t *container;
uint32_t struct_size;
uint32_t count;
uint32_t capacity;
struct dc_context *ctx;
};
bool dal_vector_construct(
struct vector *vector,
struct dc_context *ctx,
uint32_t capacity,
uint32_t struct_size);
struct vector *dal_vector_create(
struct dc_context *ctx,
uint32_t capacity,
uint32_t struct_size);
/* 'initial_value' is optional. If initial_value not supplied,
* each "structure" in the vector will contain zeros by default. */
struct vector *dal_vector_presized_create(
struct dc_context *ctx,
uint32_t size,
void *initial_value,
uint32_t struct_size);
void dal_vector_destruct(
struct vector *vector);
void dal_vector_destroy(
struct vector **vector);
uint32_t dal_vector_get_count(
const struct vector *vector);
/* dal_vector_insert_at
* reallocate container if necessary
* then shell items at right and insert
* return if the container modified
* do not check that index belongs to container
* since the function is private and index is going to be calculated
* either with by function or as get_count+1 */
bool dal_vector_insert_at(
struct vector *vector,
const void *what,
uint32_t position);
bool dal_vector_append(
struct vector *vector,
const void *item);
/* operator[] */
void *dal_vector_at_index(
const struct vector *vector,
uint32_t index);
void dal_vector_set_at_index(
const struct vector *vector,
const void *what,
uint32_t index);
/* create a clone (copy) of a vector */
struct vector *dal_vector_clone(
const struct vector *vector_other);
/* dal_vector_remove_at_index
* Shifts elements on the right from remove position to the left,
* removing an element at position by overwrite means*/
bool dal_vector_remove_at_index(
struct vector *vector,
uint32_t index);
uint32_t dal_vector_capacity(const struct vector *vector);
bool dal_vector_reserve(struct vector *vector, uint32_t capacity);
void dal_vector_clear(struct vector *vector);
/***************************************************************************
* Macro definitions of TYPE-SAFE versions of vector set/get functions.
***************************************************************************/
#define DAL_VECTOR_INSERT_AT(vector_type, type_t) \
static bool vector_type##_vector_insert_at( \
struct vector *vector, \
type_t what, \
uint32_t position) \
{ \
return dal_vector_insert_at(vector, what, position); \
Annotation
- Detected declarations: `struct vector`.
- 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.