drivers/media/platform/rockchip/rkisp1/rkisp1-resizer.c
Source file repositories/reference/linux-study-clean/drivers/media/platform/rockchip/rkisp1/rkisp1-resizer.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/media/platform/rockchip/rkisp1/rkisp1-resizer.c- Extension
.c- Size
- 22514 bytes
- Lines
- 767
- 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
rkisp1-common.h
Detected Declarations
struct rkisp1_rsz_yuv_mbus_infostruct rkisp1_rsz_configenum rkisp1_shadow_regs_whenfunction rkisp1_rsz_readfunction rkisp1_rsz_writefunction rkisp1_dcrop_disablefunction rkisp1_dcrop_configfunction rkisp1_rsz_update_shadowfunction rkisp1_rsz_calc_ratiofunction rkisp1_rsz_disablefunction rkisp1_rsz_config_regsfunction rkisp1_rsz_configfunction rkisp1_rsz_enum_mbus_codefunction rkisp1_rsz_init_statefunction rkisp1_rsz_set_src_fmtfunction rkisp1_rsz_set_sink_cropfunction rkisp1_rsz_set_sink_fmtfunction rkisp1_rsz_set_fmtfunction rkisp1_rsz_get_selectionfunction rkisp1_rsz_set_selectionfunction rkisp1_rsz_s_streamfunction rkisp1_rsz_unregisterfunction rkisp1_rsz_registerfunction rkisp1_resizer_devs_registerfunction rkisp1_resizer_devs_unregister
Annotated Snippet
struct rkisp1_rsz_yuv_mbus_info {
u32 mbus_code;
u32 hdiv;
u32 vdiv;
};
static const struct rkisp1_rsz_yuv_mbus_info rkisp1_rsz_yuv_src_formats[] = {
{
.mbus_code = MEDIA_BUS_FMT_YUYV8_2X8, /* YUV422 */
.hdiv = 2,
.vdiv = 1,
},
{
.mbus_code = MEDIA_BUS_FMT_YUYV8_1_5X8, /* YUV420 */
.hdiv = 2,
.vdiv = 2,
},
};
static const struct rkisp1_rsz_yuv_mbus_info *rkisp1_rsz_get_yuv_mbus_info(u32 mbus_code)
{
unsigned int i;
for (i = 0; i < ARRAY_SIZE(rkisp1_rsz_yuv_src_formats); i++) {
if (rkisp1_rsz_yuv_src_formats[i].mbus_code == mbus_code)
return &rkisp1_rsz_yuv_src_formats[i];
}
return NULL;
}
enum rkisp1_shadow_regs_when {
RKISP1_SHADOW_REGS_SYNC,
RKISP1_SHADOW_REGS_ASYNC,
};
struct rkisp1_rsz_config {
/* constrains */
const int max_rsz_width;
const int max_rsz_height;
const int min_rsz_width;
const int min_rsz_height;
/* registers */
struct {
u32 yuvmode_mask;
u32 rawmode_mask;
u32 h_offset;
u32 v_offset;
u32 h_size;
u32 v_size;
} dual_crop;
};
static const struct rkisp1_rsz_config rkisp1_rsz_config_mp = {
/* constraints */
.max_rsz_width = RKISP1_RSZ_MP_SRC_MAX_WIDTH,
.max_rsz_height = RKISP1_RSZ_MP_SRC_MAX_HEIGHT,
.min_rsz_width = RKISP1_RSZ_SRC_MIN_WIDTH,
.min_rsz_height = RKISP1_RSZ_SRC_MIN_HEIGHT,
/* registers */
.dual_crop = {
.yuvmode_mask = RKISP1_CIF_DUAL_CROP_MP_MODE_YUV,
.rawmode_mask = RKISP1_CIF_DUAL_CROP_MP_MODE_RAW,
.h_offset = RKISP1_CIF_DUAL_CROP_M_H_OFFS,
.v_offset = RKISP1_CIF_DUAL_CROP_M_V_OFFS,
.h_size = RKISP1_CIF_DUAL_CROP_M_H_SIZE,
.v_size = RKISP1_CIF_DUAL_CROP_M_V_SIZE,
},
};
static const struct rkisp1_rsz_config rkisp1_rsz_config_sp = {
/* constraints */
.max_rsz_width = RKISP1_RSZ_SP_SRC_MAX_WIDTH,
.max_rsz_height = RKISP1_RSZ_SP_SRC_MAX_HEIGHT,
.min_rsz_width = RKISP1_RSZ_SRC_MIN_WIDTH,
.min_rsz_height = RKISP1_RSZ_SRC_MIN_HEIGHT,
/* registers */
.dual_crop = {
.yuvmode_mask = RKISP1_CIF_DUAL_CROP_SP_MODE_YUV,
.rawmode_mask = RKISP1_CIF_DUAL_CROP_SP_MODE_RAW,
.h_offset = RKISP1_CIF_DUAL_CROP_S_H_OFFS,
.v_offset = RKISP1_CIF_DUAL_CROP_S_V_OFFS,
.h_size = RKISP1_CIF_DUAL_CROP_S_H_SIZE,
.v_size = RKISP1_CIF_DUAL_CROP_S_V_SIZE,
},
};
static inline u32 rkisp1_rsz_read(struct rkisp1_resizer *rsz, u32 offset)
{
return rkisp1_read(rsz->rkisp1, rsz->regs_base + offset);
Annotation
- Immediate include surface: `rkisp1-common.h`.
- Detected declarations: `struct rkisp1_rsz_yuv_mbus_info`, `struct rkisp1_rsz_config`, `enum rkisp1_shadow_regs_when`, `function rkisp1_rsz_read`, `function rkisp1_rsz_write`, `function rkisp1_dcrop_disable`, `function rkisp1_dcrop_config`, `function rkisp1_rsz_update_shadow`, `function rkisp1_rsz_calc_ratio`, `function rkisp1_rsz_disable`.
- 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.