drivers/gpu/drm/exynos/exynos_drm_fimc.c
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/exynos/exynos_drm_fimc.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/exynos/exynos_drm_fimc.c- Extension
.c- Size
- 36660 bytes
- Lines
- 1418
- Domain
- Driver Families
- Bucket
- drivers/gpu
- 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.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- Touches IRQ or DMA behavior; this matters for the representative real-device path.
- 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/component.hlinux/kernel.hlinux/mfd/syscon.hlinux/of.hlinux/platform_device.hlinux/pm_runtime.hlinux/regmap.hlinux/spinlock.hdrm/drm_fourcc.hdrm/drm_print.hdrm/exynos_drm.hexynos_drm_drv.hexynos_drm_ipp.hregs-fimc.h
Detected Declarations
struct fimc_scalerstruct fimc_contextfunction fimc_readfunction fimc_writefunction fimc_set_bitsfunction fimc_clear_bitsfunction fimc_sw_resetfunction fimc_set_type_ctrlfunction fimc_handle_jpegfunction fimc_mask_irqfunction fimc_clear_irqfunction fimc_check_ovffunction fimc_check_frame_endfunction fimc_get_buf_idfunction fimc_handle_lastendfunction fimc_src_set_fmt_orderfunction fimc_src_set_fmtfunction fimc_src_set_transffunction fimc_set_windowfunction fimc_src_set_sizefunction fimc_src_set_addrfunction fimc_dst_set_fmt_orderfunction fimc_dst_set_fmtfunction fimc_dst_set_transffunction fimc_set_prescalerfunction fimc_set_scalerfunction fimc_dst_set_sizefunction fimc_dst_set_buf_seqfunction fimc_dst_set_addrfunction fimc_irq_handlerfunction fimc_clear_addrfunction fimc_resetfunction fimc_startfunction fimc_stopfunction fimc_commitfunction fimc_abortfunction fimc_bindfunction fimc_unbindfunction fimc_put_clocksfunction fimc_setup_clocksfunction exynos_drm_check_fimc_devicefunction fimc_probefunction fimc_removefunction fimc_runtime_suspendfunction fimc_runtime_resume
Annotated Snippet
struct fimc_scaler {
bool range;
bool bypass;
bool up_h;
bool up_v;
u32 hratio;
u32 vratio;
};
/*
* A structure of fimc context.
*
* @regs: memory mapped io registers.
* @lock: locking of operations.
* @clocks: fimc clocks.
* @sc: scaler infomations.
* @pol: porarity of writeback.
* @id: fimc id.
* @irq: irq number.
*/
struct fimc_context {
struct exynos_drm_ipp ipp;
struct drm_device *drm_dev;
void *dma_priv;
struct device *dev;
struct exynos_drm_ipp_task *task;
struct exynos_drm_ipp_formats *formats;
unsigned int num_formats;
void __iomem *regs;
spinlock_t lock;
struct clk *clocks[FIMC_CLKS_MAX];
struct fimc_scaler sc;
int id;
int irq;
};
static u32 fimc_read(struct fimc_context *ctx, u32 reg)
{
return readl(ctx->regs + reg);
}
static void fimc_write(struct fimc_context *ctx, u32 val, u32 reg)
{
writel(val, ctx->regs + reg);
}
static void fimc_set_bits(struct fimc_context *ctx, u32 reg, u32 bits)
{
void __iomem *r = ctx->regs + reg;
writel(readl(r) | bits, r);
}
static void fimc_clear_bits(struct fimc_context *ctx, u32 reg, u32 bits)
{
void __iomem *r = ctx->regs + reg;
writel(readl(r) & ~bits, r);
}
static void fimc_sw_reset(struct fimc_context *ctx)
{
u32 cfg;
/* stop dma operation */
cfg = fimc_read(ctx, EXYNOS_CISTATUS);
if (EXYNOS_CISTATUS_GET_ENVID_STATUS(cfg))
fimc_clear_bits(ctx, EXYNOS_MSCTRL, EXYNOS_MSCTRL_ENVID);
fimc_set_bits(ctx, EXYNOS_CISRCFMT, EXYNOS_CISRCFMT_ITU601_8BIT);
/* disable image capture */
fimc_clear_bits(ctx, EXYNOS_CIIMGCPT,
EXYNOS_CIIMGCPT_IMGCPTEN_SC | EXYNOS_CIIMGCPT_IMGCPTEN);
/* s/w reset */
fimc_set_bits(ctx, EXYNOS_CIGCTRL, EXYNOS_CIGCTRL_SWRST);
/* s/w reset complete */
fimc_clear_bits(ctx, EXYNOS_CIGCTRL, EXYNOS_CIGCTRL_SWRST);
/* reset sequence */
fimc_write(ctx, 0x0, EXYNOS_CIFCNTSEQ);
}
static void fimc_set_type_ctrl(struct fimc_context *ctx)
{
u32 cfg;
Annotation
- Immediate include surface: `linux/clk.h`, `linux/component.h`, `linux/kernel.h`, `linux/mfd/syscon.h`, `linux/of.h`, `linux/platform_device.h`, `linux/pm_runtime.h`, `linux/regmap.h`.
- Detected declarations: `struct fimc_scaler`, `struct fimc_context`, `function fimc_read`, `function fimc_write`, `function fimc_set_bits`, `function fimc_clear_bits`, `function fimc_sw_reset`, `function fimc_set_type_ctrl`, `function fimc_handle_jpeg`, `function fimc_mask_irq`.
- Atlas domain: Driver Families / drivers/gpu.
- Implementation status: source implementation candidate.
- Synchronization appears in or near this file; preserve lock ordering, sleepability, and interrupt-context constraints.
- IRQ or DMA behavior appears here, which is relevant to the selected PCIe/NVMe device path.
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.