drivers/staging/media/sunxi/cedrus/cedrus.c
Source file repositories/reference/linux-study-clean/drivers/staging/media/sunxi/cedrus/cedrus.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/staging/media/sunxi/cedrus/cedrus.c- Extension
.c- Size
- 17316 bytes
- Lines
- 724
- 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.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- 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/platform_device.hlinux/module.hlinux/of.hlinux/pm.hmedia/v4l2-device.hmedia/v4l2-ioctl.hmedia/v4l2-ctrls.hmedia/v4l2-mem2mem.hcedrus.hcedrus_video.hcedrus_dec.hcedrus_hw.h
Detected Declarations
function Copyrightfunction cedrus_get_num_of_controlsfunction cedrus_init_ctrlsfunction cedrus_request_validatefunction list_for_each_entryfunction cedrus_openfunction cedrus_releasefunction cedrus_probefunction cedrus_remove
Annotated Snippet
if (vb2_is_busy(vq)) {
if (ctx->bit_depth < bit_depth)
return -EINVAL;
} else {
ctx->bit_depth = bit_depth;
cedrus_reset_cap_format(ctx);
}
}
return 0;
}
static const struct v4l2_ctrl_ops cedrus_ctrl_ops = {
.try_ctrl = cedrus_try_ctrl,
};
static const struct cedrus_control cedrus_controls[] = {
{
.cfg = {
.id = V4L2_CID_STATELESS_MPEG2_SEQUENCE,
},
.capabilities = CEDRUS_CAPABILITY_MPEG2_DEC,
},
{
.cfg = {
.id = V4L2_CID_STATELESS_MPEG2_PICTURE,
},
.capabilities = CEDRUS_CAPABILITY_MPEG2_DEC,
},
{
.cfg = {
.id = V4L2_CID_STATELESS_MPEG2_QUANTISATION,
},
.capabilities = CEDRUS_CAPABILITY_MPEG2_DEC,
},
{
.cfg = {
.id = V4L2_CID_STATELESS_H264_DECODE_PARAMS,
},
.capabilities = CEDRUS_CAPABILITY_H264_DEC,
},
{
.cfg = {
.id = V4L2_CID_STATELESS_H264_SLICE_PARAMS,
},
.capabilities = CEDRUS_CAPABILITY_H264_DEC,
},
{
.cfg = {
.id = V4L2_CID_STATELESS_H264_SPS,
.ops = &cedrus_ctrl_ops,
},
.capabilities = CEDRUS_CAPABILITY_H264_DEC,
},
{
.cfg = {
.id = V4L2_CID_STATELESS_H264_PPS,
},
.capabilities = CEDRUS_CAPABILITY_H264_DEC,
},
{
.cfg = {
.id = V4L2_CID_STATELESS_H264_SCALING_MATRIX,
},
.capabilities = CEDRUS_CAPABILITY_H264_DEC,
},
{
.cfg = {
.id = V4L2_CID_STATELESS_H264_PRED_WEIGHTS,
},
.capabilities = CEDRUS_CAPABILITY_H264_DEC,
},
{
.cfg = {
.id = V4L2_CID_STATELESS_H264_DECODE_MODE,
.max = V4L2_STATELESS_H264_DECODE_MODE_SLICE_BASED,
.def = V4L2_STATELESS_H264_DECODE_MODE_SLICE_BASED,
},
.capabilities = CEDRUS_CAPABILITY_H264_DEC,
},
{
.cfg = {
.id = V4L2_CID_STATELESS_H264_START_CODE,
.max = V4L2_STATELESS_H264_START_CODE_NONE,
.def = V4L2_STATELESS_H264_START_CODE_NONE,
},
.capabilities = CEDRUS_CAPABILITY_H264_DEC,
},
/*
* We only expose supported profiles information,
Annotation
- Immediate include surface: `linux/platform_device.h`, `linux/module.h`, `linux/of.h`, `linux/pm.h`, `media/v4l2-device.h`, `media/v4l2-ioctl.h`, `media/v4l2-ctrls.h`, `media/v4l2-mem2mem.h`.
- Detected declarations: `function Copyright`, `function cedrus_get_num_of_controls`, `function cedrus_init_ctrls`, `function cedrus_request_validate`, `function list_for_each_entry`, `function cedrus_open`, `function cedrus_release`, `function cedrus_probe`, `function cedrus_remove`.
- Atlas domain: Driver Families / drivers/staging.
- 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.