drivers/media/platform/mediatek/mdp3/mtk-mdp3-comp.c
Source file repositories/reference/linux-study-clean/drivers/media/platform/mediatek/mdp3/mtk-mdp3-comp.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/media/platform/mediatek/mdp3/mtk-mdp3-comp.c- Extension
.c- Size
- 60849 bytes
- Lines
- 2021
- 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/clk.hlinux/of_platform.hlinux/of_address.hlinux/pm_runtime.hmtk-mdp3-cfg.hmtk-mdp3-comp.hmtk-mdp3-core.hmtk-mdp3-regs.hmdp_reg_aal.hmdp_reg_ccorr.hmdp_reg_color.hmdp_reg_fg.hmdp_reg_hdr.hmdp_reg_merge.hmdp_reg_ovl.hmdp_reg_pad.hmdp_reg_rdma.hmdp_reg_rsz.hmdp_reg_tdshp.hmdp_reg_wdma.hmdp_reg_wrot.h
Detected Declarations
function __get_plat_cfgfunction get_comp_flagfunction init_rdmafunction config_rdma_framefunction config_rdma_subfrmfunction wait_rdma_eventfunction init_rszfunction config_rsz_framefunction config_rsz_subfrmfunction advance_rsz_subfrmfunction init_wrotfunction config_wrot_framefunction config_wrot_subfrmfunction wait_wrot_eventfunction init_wdmafunction config_wdma_framefunction config_wdma_subfrmfunction wait_wdma_eventfunction reset_luma_histfunction init_tdshpfunction config_tdshp_framefunction config_tdshp_subfrmfunction init_colorfunction config_color_framefunction config_color_subfrmfunction init_ccorrfunction config_ccorr_subfrmfunction init_aalfunction config_aal_framefunction config_aal_subfrmfunction init_hdrfunction config_hdr_framefunction config_hdr_subfrmfunction init_fgfunction config_fg_framefunction config_fg_subfrmfunction init_ovlfunction config_ovl_framefunction config_ovl_subfrmfunction init_padfunction config_pad_subfrmfunction is_dma_capablefunction is_bypass_gce_eventfunction mdp_comp_get_idfunction mdp_comp_clock_onfunction mdp_comp_clock_offfunction mdp_comp_clocks_onfunction mdp_comp_clocks_off
Annotated Snippet
if (mdp_cfg->rdma_support_10bit && en_ufo) {
/* Setup source buffer base */
if (CFG_CHECK(MT8183, p_id))
reg = CFG_COMP(MT8183, ctx->param, rdma.ufo_dec_y);
else if (CFG_CHECK(MT8195, p_id))
reg = CFG_COMP(MT8195, ctx->param, rdma.ufo_dec_y);
MM_REG_WRITE(cmd, subsys_id, base,
MDP_RDMA_UFO_DEC_LENGTH_BASE_Y, reg);
if (CFG_CHECK(MT8183, p_id))
reg = CFG_COMP(MT8183, ctx->param, rdma.ufo_dec_c);
else if (CFG_CHECK(MT8195, p_id))
reg = CFG_COMP(MT8195, ctx->param, rdma.ufo_dec_c);
MM_REG_WRITE(cmd, subsys_id, base,
MDP_RDMA_UFO_DEC_LENGTH_BASE_C, reg);
/* Set 10bit source frame pitch */
if (block10bit) {
if (CFG_CHECK(MT8183, p_id))
reg = CFG_COMP(MT8183, ctx->param, rdma.mf_bkgd_in_pxl);
else if (CFG_CHECK(MT8195, p_id))
reg = CFG_COMP(MT8195, ctx->param, rdma.mf_bkgd_in_pxl);
MM_REG_WRITE_MASK(cmd, subsys_id, base,
MDP_RDMA_MF_BKGD_SIZE_IN_PXL,
reg, 0x001FFFFF);
}
}
if (CFG_CHECK(MT8183, p_id)) {
reg = CFG_COMP(MT8183, ctx->param, rdma.control);
rdma_con_mask = 0x1110;
} else if (CFG_CHECK(MT8195, p_id)) {
reg = CFG_COMP(MT8195, ctx->param, rdma.control);
rdma_con_mask = 0x1130;
}
MM_REG_WRITE_MASK(cmd, subsys_id, base, MDP_RDMA_CON, reg, rdma_con_mask);
/* Setup source buffer base */
if (CFG_CHECK(MT8183, p_id))
reg = CFG_COMP(MT8183, ctx->param, rdma.iova[0]);
else if (CFG_CHECK(MT8195, p_id))
reg = CFG_COMP(MT8195, ctx->param, rdma.iova[0]);
MM_REG_WRITE(cmd, subsys_id, base, MDP_RDMA_SRC_BASE_0, reg);
if (CFG_CHECK(MT8183, p_id))
reg = CFG_COMP(MT8183, ctx->param, rdma.iova[1]);
else if (CFG_CHECK(MT8195, p_id))
reg = CFG_COMP(MT8195, ctx->param, rdma.iova[1]);
MM_REG_WRITE(cmd, subsys_id, base, MDP_RDMA_SRC_BASE_1, reg);
if (CFG_CHECK(MT8183, p_id))
reg = CFG_COMP(MT8183, ctx->param, rdma.iova[2]);
else if (CFG_CHECK(MT8195, p_id))
reg = CFG_COMP(MT8195, ctx->param, rdma.iova[2]);
MM_REG_WRITE(cmd, subsys_id, base, MDP_RDMA_SRC_BASE_2, reg);
/* Setup source buffer end */
if (CFG_CHECK(MT8183, p_id))
reg = CFG_COMP(MT8183, ctx->param, rdma.iova_end[0]);
else if (CFG_CHECK(MT8195, p_id))
reg = CFG_COMP(MT8195, ctx->param, rdma.iova_end[0]);
MM_REG_WRITE(cmd, subsys_id, base, MDP_RDMA_SRC_END_0, reg);
if (CFG_CHECK(MT8183, p_id))
reg = CFG_COMP(MT8183, ctx->param, rdma.iova_end[1]);
else if (CFG_CHECK(MT8195, p_id))
reg = CFG_COMP(MT8195, ctx->param, rdma.iova_end[1]);
MM_REG_WRITE(cmd, subsys_id, base, MDP_RDMA_SRC_END_1, reg);
if (CFG_CHECK(MT8183, p_id))
reg = CFG_COMP(MT8183, ctx->param, rdma.iova_end[2]);
else if (CFG_CHECK(MT8195, p_id))
reg = CFG_COMP(MT8195, ctx->param, rdma.iova_end[2]);
MM_REG_WRITE(cmd, subsys_id, base, MDP_RDMA_SRC_END_2, reg);
/* Setup source frame pitch */
if (CFG_CHECK(MT8183, p_id))
reg = CFG_COMP(MT8183, ctx->param, rdma.mf_bkgd);
else if (CFG_CHECK(MT8195, p_id))
reg = CFG_COMP(MT8195, ctx->param, rdma.mf_bkgd);
MM_REG_WRITE_MASK(cmd, subsys_id, base, MDP_RDMA_MF_BKGD_SIZE_IN_BYTE,
reg, 0x001FFFFF);
if (CFG_CHECK(MT8183, p_id))
reg = CFG_COMP(MT8183, ctx->param, rdma.sf_bkgd);
else if (CFG_CHECK(MT8195, p_id))
reg = CFG_COMP(MT8195, ctx->param, rdma.sf_bkgd);
MM_REG_WRITE_MASK(cmd, subsys_id, base, MDP_RDMA_SF_BKGD_SIZE_IN_BYTE,
reg, 0x001FFFFF);
Annotation
- Immediate include surface: `linux/clk.h`, `linux/of_platform.h`, `linux/of_address.h`, `linux/pm_runtime.h`, `mtk-mdp3-cfg.h`, `mtk-mdp3-comp.h`, `mtk-mdp3-core.h`, `mtk-mdp3-regs.h`.
- Detected declarations: `function __get_plat_cfg`, `function get_comp_flag`, `function init_rdma`, `function config_rdma_frame`, `function config_rdma_subfrm`, `function wait_rdma_event`, `function init_rsz`, `function config_rsz_frame`, `function config_rsz_subfrm`, `function advance_rsz_subfrm`.
- 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.