drivers/platform/raspberrypi/vchiq-mmal/mmal-vchiq.h
Source file repositories/reference/linux-study-clean/drivers/platform/raspberrypi/vchiq-mmal/mmal-vchiq.h
File Facts
- System
- Linux kernel
- Corpus path
drivers/platform/raspberrypi/vchiq-mmal/mmal-vchiq.h- Extension
.h- Size
- 5000 bytes
- Lines
- 163
- Domain
- Driver Families
- Bucket
- drivers/platform
- 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.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
mmal-common.hmmal-msg-format.h
Detected Declarations
struct vchiq_mmal_instancestruct devicestruct vchiq_mmal_port_bufferstruct vchiq_mmal_portstruct vchiq_mmal_portstruct vchiq_mmal_componentenum vchiq_mmal_es_type
Annotated Snippet
struct vchiq_mmal_port_buffer {
unsigned int num; /* number of buffers */
u32 size; /* size of buffers */
u32 alignment; /* alignment of buffers */
};
struct vchiq_mmal_port;
typedef void (*vchiq_mmal_buffer_cb)(struct vchiq_mmal_instance *instance,
struct vchiq_mmal_port *port,
int status, struct mmal_buffer *buffer);
struct vchiq_mmal_port {
bool enabled;
u32 handle;
u32 type; /* port type, cached to use on port info set */
u32 index; /* port index, cached to use on port info set */
/* component port belongs to, allows simple deref */
struct vchiq_mmal_component *component;
struct vchiq_mmal_port *connected; /* port connected to */
/* buffer info */
struct vchiq_mmal_port_buffer minimum_buffer;
struct vchiq_mmal_port_buffer recommended_buffer;
struct vchiq_mmal_port_buffer current_buffer;
/* stream format */
struct mmal_es_format_local format;
/* elementary stream format */
union mmal_es_specific_format es;
/* data buffers to fill */
struct list_head buffers;
/* lock to serialise adding and removing buffers from list */
spinlock_t slock;
/* Count of buffers the VPU has yet to return */
atomic_t buffers_with_vpu;
/* callback on buffer completion */
vchiq_mmal_buffer_cb buffer_cb;
/* callback context */
void *cb_ctx;
};
struct vchiq_mmal_component {
bool in_use;
bool enabled;
u32 handle; /* VideoCore handle for component */
u32 inputs; /* Number of input ports */
u32 outputs; /* Number of output ports */
u32 clocks; /* Number of clock ports */
struct vchiq_mmal_port control; /* control port */
struct vchiq_mmal_port input[MAX_PORT_COUNT]; /* input ports */
struct vchiq_mmal_port output[MAX_PORT_COUNT]; /* output ports */
struct vchiq_mmal_port clock[MAX_PORT_COUNT]; /* clock ports */
u32 client_component; /* Used to ref back to client struct */
};
int vchiq_mmal_init(struct device *dev, struct vchiq_mmal_instance **out_instance);
int vchiq_mmal_finalise(struct vchiq_mmal_instance *instance);
/* Initialise a mmal component and its ports
*
*/
int vchiq_mmal_component_init(struct vchiq_mmal_instance *instance,
const char *name, struct vchiq_mmal_component **component_out);
int vchiq_mmal_component_finalise(struct vchiq_mmal_instance *instance,
struct vchiq_mmal_component *component);
int vchiq_mmal_component_enable(struct vchiq_mmal_instance *instance,
struct vchiq_mmal_component *component);
int vchiq_mmal_component_disable(struct vchiq_mmal_instance *instance,
struct vchiq_mmal_component *component);
/* enable a mmal port
*
* enables a port and, if a buffer callback provided, enqueues buffer
* headers as appropriate for the port.
*/
int vchiq_mmal_port_enable(struct vchiq_mmal_instance *instance,
struct vchiq_mmal_port *port,
vchiq_mmal_buffer_cb buffer_cb);
/* disable a port
*
* disable a port will dequeue any pending buffers
Annotation
- Immediate include surface: `mmal-common.h`, `mmal-msg-format.h`.
- Detected declarations: `struct vchiq_mmal_instance`, `struct device`, `struct vchiq_mmal_port_buffer`, `struct vchiq_mmal_port`, `struct vchiq_mmal_port`, `struct vchiq_mmal_component`, `enum vchiq_mmal_es_type`.
- Atlas domain: Driver Families / drivers/platform.
- Implementation status: source implementation candidate.
- Synchronization appears in or near this file; preserve lock ordering, sleepability, and interrupt-context constraints.
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.