drivers/staging/media/imx/imx-media.h
Source file repositories/reference/linux-study-clean/drivers/staging/media/imx/imx-media.h
File Facts
- System
- Linux kernel
- Corpus path
drivers/staging/media/imx/imx-media.h- Extension
.h- Size
- 9059 bytes
- Lines
- 301
- Domain
- Driver Families
- Bucket
- drivers/staging
- 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
linux/platform_device.hmedia/v4l2-ctrls.hmedia/v4l2-device.hmedia/v4l2-fwnode.hmedia/v4l2-subdev.hmedia/videobuf2-dma-contig.hvideo/imx-ipu-v3.h
Detected Declarations
struct imx_media_pixfmtstruct imx_media_bufferstruct imx_media_video_devstruct imx_media_pad_vdevstruct imx_media_devstruct imx_media_dma_bufstruct imx_media_fimenum imx_pixfmt_selfunction to_pad_vdev_listfunction imx_media_find_ipu_formatfunction imx_media_enum_ipu_formats
Annotated Snippet
struct imx_media_pixfmt {
/* the in-memory FourCC pixel format */
u32 fourcc;
/*
* the set of equivalent media bus codes for the fourcc.
* NOTE! codes pointer is NULL for in-memory-only formats.
*/
const u32 *codes;
int bpp; /* total bpp */
/* cycles per pixel for generic (bayer) formats for the parallel bus */
int cycles;
enum ipu_color_space cs;
bool planar; /* is a planar format */
bool bayer; /* is a raw bayer format */
bool ipufmt; /* is one of the IPU internal formats */
};
enum imx_pixfmt_sel {
PIXFMT_SEL_YUV = BIT(0), /* select YUV formats */
PIXFMT_SEL_RGB = BIT(1), /* select RGB formats */
PIXFMT_SEL_BAYER = BIT(2), /* select BAYER formats */
PIXFMT_SEL_IPU = BIT(3), /* select IPU-internal formats */
PIXFMT_SEL_YUV_RGB = PIXFMT_SEL_YUV | PIXFMT_SEL_RGB,
PIXFMT_SEL_ANY = PIXFMT_SEL_YUV | PIXFMT_SEL_RGB | PIXFMT_SEL_BAYER,
};
struct imx_media_buffer {
struct vb2_v4l2_buffer vbuf; /* v4l buffer must be first */
struct list_head list;
};
struct imx_media_video_dev {
struct video_device *vfd;
/* the pipeline object */
struct media_pipeline pipe;
/* the user format */
struct v4l2_pix_format fmt;
/* the compose rectangle */
struct v4l2_rect compose;
const struct imx_media_pixfmt *cc;
/* links this vdev to master list */
struct list_head list;
};
static inline struct imx_media_buffer *to_imx_media_vb(struct vb2_buffer *vb)
{
struct vb2_v4l2_buffer *vbuf = to_vb2_v4l2_buffer(vb);
return container_of(vbuf, struct imx_media_buffer, vbuf);
}
/*
* to support control inheritance to video devices, this
* retrieves a pad's list_head of video devices that can
* be reached from the pad. Note that only the lists in
* source pads get populated, sink pads have empty lists.
*/
static inline struct list_head *
to_pad_vdev_list(struct v4l2_subdev *sd, int pad_index)
{
struct list_head *vdev_list = sd->host_priv;
return vdev_list ? &vdev_list[pad_index] : NULL;
}
/* an entry in a pad's video device list */
struct imx_media_pad_vdev {
struct imx_media_video_dev *vdev;
struct list_head list;
};
struct imx_media_dev {
struct media_device md;
struct v4l2_device v4l2_dev;
struct mutex mutex; /* protect elements below */
/* master video device list */
struct list_head vdev_list;
/* IPUs this media driver control, valid after subdevs bound */
struct ipu_soc *ipu[2];
/* for async subdev registration */
struct v4l2_async_notifier notifier;
/* IC scaler/CSC mem2mem video device */
Annotation
- Immediate include surface: `linux/platform_device.h`, `media/v4l2-ctrls.h`, `media/v4l2-device.h`, `media/v4l2-fwnode.h`, `media/v4l2-subdev.h`, `media/videobuf2-dma-contig.h`, `video/imx-ipu-v3.h`.
- Detected declarations: `struct imx_media_pixfmt`, `struct imx_media_buffer`, `struct imx_media_video_dev`, `struct imx_media_pad_vdev`, `struct imx_media_dev`, `struct imx_media_dma_buf`, `struct imx_media_fim`, `enum imx_pixfmt_sel`, `function to_pad_vdev_list`, `function imx_media_find_ipu_format`.
- Atlas domain: Driver Families / drivers/staging.
- 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.