drivers/media/platform/raspberrypi/pisp_be/pisp_be.c
Source file repositories/reference/linux-study-clean/drivers/media/platform/raspberrypi/pisp_be/pisp_be.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/media/platform/raspberrypi/pisp_be/pisp_be.c- Extension
.c- Size
- 50520 bytes
- Lines
- 1797
- Domain
- Driver Families
- Bucket
- drivers/media
- 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.
- Touches IRQ or DMA behavior; this matters for the representative real-device path.
- Allocates kernel memory; connect allocation flags and lifetime to context constraints.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/clk.hlinux/interrupt.hlinux/io.hlinux/kernel.hlinux/lockdep.hlinux/minmax.hlinux/module.hlinux/platform_device.hlinux/pm_runtime.hlinux/slab.hmedia/v4l2-device.hmedia/v4l2-ioctl.hmedia/videobuf2-dma-contig.hmedia/videobuf2-vmalloc.huapi/linux/media/raspberrypi/pisp_be_config.hpisp_be_formats.h
Detected Declarations
struct pispbe_node_descriptionstruct pispbe_nodestruct pispbe_jobstruct pispbe_hw_enablesstruct pispbe_job_descriptorstruct pispbe_devstruct pispbe_bufferenum pispbe_node_idsfunction pispbe_rdfunction pispbe_wrfunction pispbe_queue_jobfunction pispbe_get_planes_addrfunction pispbe_get_addrfunction pispbe_xlate_addrsfunction pispbe_prepare_jobfunction scoped_guardfunction scoped_guardfunction pispbe_schedulefunction scoped_guardfunction pispbe_isr_jobdonefunction pispbe_isrfunction pisp_be_validate_configfunction pispbe_node_queue_setupfunction pispbe_node_buffer_preparefunction pispbe_node_buffer_queuefunction pispbe_node_start_streamingfunction scoped_guardfunction pispbe_node_stop_streamingfunction list_for_each_entry_safefunction pispbe_node_querycapfunction pispbe_node_g_fmt_vid_capfunction pispbe_node_g_fmt_vid_outfunction pispbe_node_g_fmt_meta_outfunction pispbe_set_plane_paramsfunction pispbe_try_formatfunction pispbe_node_try_fmt_vid_capfunction pispbe_node_try_fmt_vid_outfunction pispbe_node_try_fmt_meta_outfunction pispbe_node_s_fmt_vid_capfunction pispbe_node_s_fmt_vid_outfunction pispbe_node_s_fmt_meta_outfunction pispbe_node_enum_fmtfunction pispbe_enum_framesizesfunction pispbe_node_def_fmtfunction pispbe_init_nodefunction pispbe_init_subdevfunction pispbe_init_devicesfunction pispbe_destroy_devices
Annotated Snippet
struct pispbe_node_description {
const char *ent_name;
enum v4l2_buf_type buf_type;
unsigned int caps;
};
static const struct pispbe_node_description node_desc[PISPBE_NUM_NODES] = {
/* MAIN_INPUT_NODE */
{
.ent_name = PISPBE_NAME "-input",
.buf_type = V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE,
.caps = V4L2_CAP_VIDEO_OUTPUT_MPLANE,
},
/* TDN_INPUT_NODE */
{
.ent_name = PISPBE_NAME "-tdn_input",
.buf_type = V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE,
.caps = V4L2_CAP_VIDEO_OUTPUT_MPLANE,
},
/* STITCH_INPUT_NODE */
{
.ent_name = PISPBE_NAME "-stitch_input",
.buf_type = V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE,
.caps = V4L2_CAP_VIDEO_OUTPUT_MPLANE,
},
/* OUTPUT0_NODE */
{
.ent_name = PISPBE_NAME "-output0",
.buf_type = V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE,
.caps = V4L2_CAP_VIDEO_CAPTURE_MPLANE,
},
/* OUTPUT1_NODE */
{
.ent_name = PISPBE_NAME "-output1",
.buf_type = V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE,
.caps = V4L2_CAP_VIDEO_CAPTURE_MPLANE,
},
/* TDN_OUTPUT_NODE */
{
.ent_name = PISPBE_NAME "-tdn_output",
.buf_type = V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE,
.caps = V4L2_CAP_VIDEO_CAPTURE_MPLANE,
},
/* STITCH_OUTPUT_NODE */
{
.ent_name = PISPBE_NAME "-stitch_output",
.buf_type = V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE,
.caps = V4L2_CAP_VIDEO_CAPTURE_MPLANE,
},
/* CONFIG_NODE */
{
.ent_name = PISPBE_NAME "-config",
.buf_type = V4L2_BUF_TYPE_META_OUTPUT,
.caps = V4L2_CAP_META_OUTPUT,
}
};
#define NODE_DESC_IS_OUTPUT(desc) ( \
((desc)->buf_type == V4L2_BUF_TYPE_META_OUTPUT) || \
((desc)->buf_type == V4L2_BUF_TYPE_VIDEO_OUTPUT) || \
((desc)->buf_type == V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE))
#define NODE_IS_META(node) ( \
((node)->buf_type == V4L2_BUF_TYPE_META_OUTPUT))
#define NODE_IS_OUTPUT(node) ( \
((node)->buf_type == V4L2_BUF_TYPE_META_OUTPUT) || \
((node)->buf_type == V4L2_BUF_TYPE_VIDEO_OUTPUT) || \
((node)->buf_type == V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE))
#define NODE_IS_CAPTURE(node) ( \
((node)->buf_type == V4L2_BUF_TYPE_VIDEO_CAPTURE) || \
((node)->buf_type == V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE))
#define NODE_IS_MPLANE(node) ( \
((node)->buf_type == V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE) || \
((node)->buf_type == V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE))
/*
* Structure to describe a single node /dev/video<N> which represents a single
* input or output queue to the PiSP Back End device.
*/
struct pispbe_node {
unsigned int id;
int vfl_dir;
enum v4l2_buf_type buf_type;
struct video_device vfd;
struct media_pad pad;
struct media_intf_devnode *intf_devnode;
struct media_link *intf_link;
struct pispbe_dev *pispbe;
/* Video device lock */
struct mutex node_lock;
Annotation
- Immediate include surface: `linux/clk.h`, `linux/interrupt.h`, `linux/io.h`, `linux/kernel.h`, `linux/lockdep.h`, `linux/minmax.h`, `linux/module.h`, `linux/platform_device.h`.
- Detected declarations: `struct pispbe_node_description`, `struct pispbe_node`, `struct pispbe_job`, `struct pispbe_hw_enables`, `struct pispbe_job_descriptor`, `struct pispbe_dev`, `struct pispbe_buffer`, `enum pispbe_node_ids`, `function pispbe_rd`, `function pispbe_wr`.
- Atlas domain: Driver Families / drivers/media.
- Implementation status: source implementation candidate.
- Synchronization appears in or near this file; preserve lock ordering, sleepability, and interrupt-context constraints.
- IRQ or DMA behavior appears here, which is relevant to the selected PCIe/NVMe device path.
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.