drivers/media/platform/renesas/vsp1/vsp1_drm.c
Source file repositories/reference/linux-study-clean/drivers/media/platform/renesas/vsp1/vsp1_drm.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/media/platform/renesas/vsp1/vsp1_drm.c- Extension
.c- Size
- 28935 bytes
- Lines
- 1026
- Domain
- Driver Families
- Bucket
- drivers/media
- Inferred role
- Driver Families: exported/initcall integration point
- Status
- integration 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.
- Exports symbols or registers init work; inspect boot/module ordering and who consumes the exported contract.
- 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/device.hlinux/dma-mapping.hlinux/export.hlinux/slab.hmedia/media-entity.hmedia/v4l2-subdev.hmedia/vsp1.hvsp1.hvsp1_brx.hvsp1_dl.hvsp1_drm.hvsp1_lif.hvsp1_pipe.hvsp1_rwpf.hvsp1_uif.h
Detected Declarations
function Copyrightfunction vsp1_du_pipeline_configurefunction list_for_each_entry_safefunction vsp1_du_insert_uiffunction vsp1_du_pipeline_setup_rpffunction vsp1_du_pipeline_setup_brxfunction rpf_zposfunction vsp1_du_pipeline_setup_inputsfunction vsp1_du_pipeline_setup_outputfunction vsp1_du_pipeline_set_rwpf_formatfunction vsp1_du_initfunction vsp1_du_setup_rpffunction scoped_guardfunction vsp1_du_disablefunction scoped_guardfunction vsp1_du_atomic_beginfunction vsp1_du_atomic_updatefunction vsp1_du_atomic_flushfunction vsp1_du_map_sgfunction vsp1_du_unmap_sgfunction vsp1_drm_initfunction vsp1_drm_cleanupexport vsp1_du_initexport vsp1_du_enableexport vsp1_du_disableexport vsp1_du_atomic_beginexport vsp1_du_atomic_updateexport vsp1_du_atomic_flushexport vsp1_du_map_sgexport vsp1_du_unmap_sg
Annotated Snippet
if (!entity->pipe) {
vsp1_dl_body_write(dlb, entity->route->reg,
VI6_DPR_NODE_UNUSED);
entity->sink = NULL;
list_del(&entity->list_pipe);
continue;
}
vsp1_entity_route_setup(entity, pipe, dlb);
vsp1_entity_configure_stream(entity, entity->state, pipe,
dl, dlb);
vsp1_entity_configure_frame(entity, pipe, dl, dlb);
vsp1_entity_configure_partition(entity, pipe,
&pipe->part_table[0], dl, dlb);
}
vsp1_dl_list_commit(dl, dl_flags);
}
/*
* Insert the UIF in the pipeline between the prev and next entities. If no UIF
* is available connect the two entities directly.
*/
static int vsp1_du_insert_uif(struct vsp1_device *vsp1,
struct vsp1_pipeline *pipe,
struct vsp1_entity *uif,
struct vsp1_entity *prev, unsigned int prev_pad,
struct vsp1_entity *next, unsigned int next_pad)
{
struct v4l2_subdev_format format = {
.which = V4L2_SUBDEV_FORMAT_ACTIVE,
};
int ret;
if (!uif) {
/*
* If there's no UIF to be inserted, connect the previous and
* next entities directly.
*/
prev->sink = next;
prev->sink_pad = next_pad;
return 0;
}
prev->sink = uif;
prev->sink_pad = UIF_PAD_SINK;
format.pad = prev_pad;
ret = v4l2_subdev_call(&prev->subdev, pad, get_fmt, NULL, &format);
if (ret < 0)
return ret;
format.pad = UIF_PAD_SINK;
ret = v4l2_subdev_call(&uif->subdev, pad, set_fmt, NULL, &format);
if (ret < 0)
return ret;
dev_dbg(vsp1->dev, "%s: set format %ux%u (%x) on UIF sink\n",
__func__, format.format.width, format.format.height,
format.format.code);
/*
* The UIF doesn't mangle the format between its sink and source pads,
* so there is no need to retrieve the format on its source pad.
*/
uif->sink = next;
uif->sink_pad = next_pad;
return 0;
}
/* Setup one RPF and the connected BRx sink pad. */
static int vsp1_du_pipeline_setup_rpf(struct vsp1_device *vsp1,
struct vsp1_pipeline *pipe,
struct vsp1_rwpf *rpf,
struct vsp1_entity *uif,
unsigned int brx_input)
{
const struct vsp1_drm_input *input = &vsp1->drm->inputs[rpf->entity.index];
struct v4l2_subdev_selection sel = {
.which = V4L2_SUBDEV_FORMAT_ACTIVE,
};
struct v4l2_subdev_format format = {
.which = V4L2_SUBDEV_FORMAT_ACTIVE,
};
Annotation
- Immediate include surface: `linux/device.h`, `linux/dma-mapping.h`, `linux/export.h`, `linux/slab.h`, `media/media-entity.h`, `media/v4l2-subdev.h`, `media/vsp1.h`, `vsp1.h`.
- Detected declarations: `function Copyright`, `function vsp1_du_pipeline_configure`, `function list_for_each_entry_safe`, `function vsp1_du_insert_uif`, `function vsp1_du_pipeline_setup_rpf`, `function vsp1_du_pipeline_setup_brx`, `function rpf_zpos`, `function vsp1_du_pipeline_setup_inputs`, `function vsp1_du_pipeline_setup_output`, `function vsp1_du_pipeline_set_rwpf_format`.
- Atlas domain: Driver Families / drivers/media.
- Implementation status: integration 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.