drivers/media/v4l2-core/v4l2-isp.c
Source file repositories/reference/linux-study-clean/drivers/media/v4l2-core/v4l2-isp.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/media/v4l2-core/v4l2-isp.c- Extension
.c- Size
- 4029 bytes
- Lines
- 133
- 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.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
media/v4l2-isp.hlinux/bitops.hlinux/device.hmedia/videobuf2-core.h
Detected Declarations
function Copyrightfunction v4l2_isp_params_validate_bufferexport v4l2_isp_params_validate_buffer_sizeexport v4l2_isp_params_validate_buffer
Annotated Snippet
if (block->type >= num_block_types) {
dev_dbg(dev,
"Invalid block type %u at offset %zu\n",
block->type, block_offset);
return -EINVAL;
}
if (block->size > buffer_size) {
dev_dbg(dev, "Premature end of parameters data\n");
return -EINVAL;
}
/* It's invalid to specify both ENABLE and DISABLE. */
if ((block->flags & (V4L2_ISP_PARAMS_FL_BLOCK_ENABLE |
V4L2_ISP_PARAMS_FL_BLOCK_DISABLE)) ==
(V4L2_ISP_PARAMS_FL_BLOCK_ENABLE |
V4L2_ISP_PARAMS_FL_BLOCK_DISABLE)) {
dev_dbg(dev, "Invalid block flags %x at offset %zu\n",
block->flags, block_offset);
return -EINVAL;
}
/*
* Match the block reported size against the type info provided
* one, but allow the block to only contain the header in
* case it is going to be disabled.
*/
info = &type_info[block->type];
if (block->size != info->size &&
(!(block->flags & V4L2_ISP_PARAMS_FL_BLOCK_DISABLE) ||
block->size != sizeof(*block))) {
dev_dbg(dev,
"Invalid block size %u (expected %zu) at offset %zu\n",
block->size, info->size, block_offset);
return -EINVAL;
}
block_offset += block->size;
buffer_size -= block->size;
}
if (buffer_size) {
dev_dbg(dev, "Unexpected data after the parameters buffer end\n");
return -EINVAL;
}
return 0;
}
EXPORT_SYMBOL_GPL(v4l2_isp_params_validate_buffer);
MODULE_LICENSE("GPL");
MODULE_AUTHOR("Jacopo Mondi <jacopo.mondi@ideasonboard.com");
MODULE_DESCRIPTION("V4L2 generic ISP parameters and statistics helpers");
Annotation
- Immediate include surface: `media/v4l2-isp.h`, `linux/bitops.h`, `linux/device.h`, `media/videobuf2-core.h`.
- Detected declarations: `function Copyright`, `function v4l2_isp_params_validate_buffer`, `export v4l2_isp_params_validate_buffer_size`, `export v4l2_isp_params_validate_buffer`.
- Atlas domain: Driver Families / drivers/media.
- Implementation status: integration 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.