drivers/media/platform/st/stm32/stm32-dcmipp/dcmipp-byteproc.c
Source file repositories/reference/linux-study-clean/drivers/media/platform/st/stm32/stm32-dcmipp/dcmipp-byteproc.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/media/platform/st/stm32/stm32-dcmipp/dcmipp-byteproc.c- Extension
.c- Size
- 16674 bytes
- Lines
- 607
- 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.
- 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/vmalloc.hlinux/v4l2-mediabus.hmedia/v4l2-rect.hmedia/v4l2-subdev.hdcmipp-common.h
Detected Declarations
struct dcmipp_byteproc_pix_mapstruct dcmipp_byteproc_devicefunction dcmipp_byteproc_pix_map_by_codefunction dcmipp_byteproc_adjust_cropfunction dcmipp_byteproc_adjust_composefunction dcmipp_byteproc_adjust_fmtfunction dcmipp_byteproc_init_statefunction dcmipp_byteproc_enum_mbus_codefunction dcmipp_byteproc_enum_frame_sizefunction dcmipp_byteproc_set_fmtfunction dcmipp_byteproc_get_selectionfunction dcmipp_byteproc_set_selectionfunction dcmipp_byteproc_configure_scale_cropfunction dcmipp_byteproc_enable_streamsfunction dcmipp_byteproc_disable_streamsfunction dcmipp_byteproc_releasefunction dcmipp_byteproc_ent_releasefunction dcmipp_byteproc_ent_init
Annotated Snippet
struct dcmipp_byteproc_pix_map {
unsigned int code;
unsigned int bpp;
};
#define PIXMAP_MBUS_BPP(mbus, byteperpixel) \
{ \
.code = MEDIA_BUS_FMT_##mbus, \
.bpp = byteperpixel, \
}
static const struct dcm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8, 1),
};
static const struct dcmipp_byteproc_pix_map *
dcmipp_byteproc_pix_map_by_code(u32 code)
{
unsigned int i;
for (i = 0; i < ARRAY_SIZE(dcmipp_byteproc_pix_map_list); i++) {
if (dcmipp_byteproc_pix_map_list[i].code == code)
return &dcmipp_byteproc_pix_map_list[i];
}
return NULL;
}
struct dcmipp_byteproc_device {
struct dcmipp_ent_device ved;
struct v4l2_subdev sd;
struct device *dev;
void __iomem *regs;
};
static const struct v4l2_mbus_framefmt fmt_default = {
.width = DCMIPP_FMT_WIDTH_DEFAULT,
.height = DCMIPP_FMT_HEIGHT_DEFAULT,
.code = MEDIA_BUS_FMT_RGB565_2X8_LE,
.field = V4L2_FIELD_NONE,
.colorspace = DCMIPP_COLORSPACE_DEFAULT,
.ycbcr_enc = DCMIPP_YCBCR_ENC_DEFAULT,
.quantization = DCMIPP_QUANTIZATION_DEFAULT,
.xfer_func = DCMIPP_XFER_FUNC_DEFAULT,
};
static const struct v4l2_rect crop_min = {
.width = DCMIPP_FRAME_MIN_WIDTH,
.height = DCMIPP_FRAME_MIN_HEIGHT,
.top = 0,
.left = 0,
};
static void dcmipp_byteproc_adjust_crop(struct v4l2_rect *r,
struct v4l2_rect *compose)
{
/* Disallow rectangles smaller than the minimal one. */
v4l2_rect_set_min_size(r, &crop_min);
v4l2_rect_map_inside(r, compose);
Annotation
- Immediate include surface: `linux/vmalloc.h`, `linux/v4l2-mediabus.h`, `media/v4l2-rect.h`, `media/v4l2-subdev.h`, `dcmipp-common.h`.
- Detected declarations: `struct dcmipp_byteproc_pix_map`, `struct dcmipp_byteproc_device`, `function dcmipp_byteproc_pix_map_by_code`, `function dcmipp_byteproc_adjust_crop`, `function dcmipp_byteproc_adjust_compose`, `function dcmipp_byteproc_adjust_fmt`, `function dcmipp_byteproc_init_state`, `function dcmipp_byteproc_enum_mbus_code`, `function dcmipp_byteproc_enum_frame_size`, `function dcmipp_byteproc_set_fmt`.
- Atlas domain: Driver Families / drivers/media.
- 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.