drivers/media/platform/amlogic/c3/isp/c3-isp-resizer.c
Source file repositories/reference/linux-study-clean/drivers/media/platform/amlogic/c3/isp/c3-isp-resizer.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/media/platform/amlogic/c3/isp/c3-isp-resizer.c- Extension
.c- Size
- 26178 bytes
- Lines
- 893
- 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.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/pm_runtime.hc3-isp-common.hc3-isp-regs.h
Detected Declarations
struct c3_isp_rsz_format_infostruct c3_isp_pps_io_sizefunction c3_isp_rsz_pps_sizefunction c3_isp_rsz_pps_lutfunction c3_isp_rsz_pps_disablefunction c3_isp_rsz_pps_enablefunction c3_isp_rsz_startfunction c3_isp_rsz_stopfunction c3_isp_rsz_enable_streamsfunction c3_isp_rsz_disable_streamsfunction c3_isp_rsz_enum_mbus_codefunction c3_isp_rsz_set_sink_fmtfunction c3_isp_rsz_set_source_fmtfunction c3_isp_rsz_set_fmtfunction c3_isp_rsz_get_selectionfunction c3_isp_rsz_set_selectionfunction c3_isp_rsz_init_statefunction c3_isp_rsz_registerfunction c3_isp_rsz_unregisterfunction c3_isp_resizers_registerfunction c3_isp_resizers_unregister
Annotated Snippet
struct c3_isp_rsz_format_info {
u32 mbus_code;
u32 pads;
bool is_raw;
};
static const struct c3_isp_rsz_format_info c3_isp_rsz_fmts[] = {
/* RAW formats */
{
.mbus_code = MEDIA_BUS_FMT_SBGGR16_1X16,
.pads = BIT(C3_ISP_RSZ_PAD_SINK)
| BIT(C3_ISP_RSZ_PAD_SOURCE),
.is_raw = true,
}, {
.mbus_code = MEDIA_BUS_FMT_SGBRG16_1X16,
.pads = BIT(C3_ISP_RSZ_PAD_SINK)
| BIT(C3_ISP_RSZ_PAD_SOURCE),
.is_raw = true,
}, {
.mbus_code = MEDIA_BUS_FMT_SGRBG16_1X16,
.pads = BIT(C3_ISP_RSZ_PAD_SINK)
| BIT(C3_ISP_RSZ_PAD_SOURCE),
.is_raw = true,
}, {
.mbus_code = MEDIA_BUS_FMT_SRGGB16_1X16,
.pads = BIT(C3_ISP_RSZ_PAD_SINK)
| BIT(C3_ISP_RSZ_PAD_SOURCE),
.is_raw = true,
},
/* YUV formats */
{
.mbus_code = MEDIA_BUS_FMT_YUV10_1X30,
.pads = BIT(C3_ISP_RSZ_PAD_SINK)
| BIT(C3_ISP_RSZ_PAD_SOURCE),
.is_raw = false,
},
};
/*
* struct c3_isp_pps_io_size - ISP scaler input and output size
*
* @thsize: input horizontal size of after preprocessing
* @tvsize: input vertical size of after preprocessing
* @ohsize: output horizontal size
* @ovsize: output vertical size
* @ihsize: input horizontal size
* @max_hsize: maximum horizontal size
*/
struct c3_isp_pps_io_size {
u32 thsize;
u32 tvsize;
u32 ohsize;
u32 ovsize;
u32 ihsize;
u32 max_hsize;
};
/* The normal parameters of pps module */
static const int c3_isp_pps_lut[C3_ISP_PPS_LUT_H_NUM][4] = {
{ 0, 511, 0, 0}, { -5, 511, 5, 0}, {-10, 511, 11, 0},
{-14, 510, 17, -1}, {-18, 508, 23, -1}, {-22, 506, 29, -1},
{-25, 503, 36, -2}, {-28, 500, 43, -3}, {-32, 496, 51, -3},
{-34, 491, 59, -4}, {-37, 487, 67, -5}, {-39, 482, 75, -6},
{-41, 476, 84, -7}, {-42, 470, 92, -8}, {-44, 463, 102, -9},
{-45, 456, 111, -10}, {-45, 449, 120, -12}, {-47, 442, 130, -13},
{-47, 434, 140, -15}, {-47, 425, 151, -17}, {-47, 416, 161, -18},
{-47, 407, 172, -20}, {-47, 398, 182, -21}, {-47, 389, 193, -23},
{-46, 379, 204, -25}, {-45, 369, 215, -27}, {-44, 358, 226, -28},
{-43, 348, 237, -30}, {-43, 337, 249, -31}, {-41, 326, 260, -33},
{-40, 316, 271, -35}, {-39, 305, 282, -36}, {-37, 293, 293, -37}
};
static const struct c3_isp_rsz_format_info
*rsz_find_format_by_code(u32 code, u32 pad)
{
for (unsigned int i = 0; i < ARRAY_SIZE(c3_isp_rsz_fmts); i++) {
const struct c3_isp_rsz_format_info *info = &c3_isp_rsz_fmts[i];
if (info->mbus_code == code && info->pads & BIT(pad))
return info;
}
return NULL;
}
static const struct c3_isp_rsz_format_info
*rsz_find_format_by_index(u32 index, u32 pad)
{
for (unsigned int i = 0; i < ARRAY_SIZE(c3_isp_rsz_fmts); i++) {
const struct c3_isp_rsz_format_info *info = &c3_isp_rsz_fmts[i];
Annotation
- Immediate include surface: `linux/pm_runtime.h`, `c3-isp-common.h`, `c3-isp-regs.h`.
- Detected declarations: `struct c3_isp_rsz_format_info`, `struct c3_isp_pps_io_size`, `function c3_isp_rsz_pps_size`, `function c3_isp_rsz_pps_lut`, `function c3_isp_rsz_pps_disable`, `function c3_isp_rsz_pps_enable`, `function c3_isp_rsz_start`, `function c3_isp_rsz_stop`, `function c3_isp_rsz_enable_streams`, `function c3_isp_rsz_disable_streams`.
- 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.