drivers/gpu/drm/exynos/exynos5433_drm_decon.c
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/exynos/exynos5433_drm_decon.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/exynos/exynos5433_drm_decon.c- Extension
.c- Size
- 22814 bytes
- Lines
- 882
- 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/iopoll.hlinux/irq.hlinux/mfd/syscon.hlinux/of.hlinux/platform_device.hlinux/pm_runtime.hlinux/regmap.hdrm/drm_blend.hdrm/drm_fourcc.hdrm/drm_framebuffer.hdrm/drm_print.hdrm/drm_vblank.hexynos_drm_crtc.hexynos_drm_drv.hexynos_drm_fb.hexynos_drm_plane.hregs-decon5433.h
Detected Declarations
struct decon_contextfunction decon_set_bitsfunction decon_enable_vblankfunction decon_disable_vblankfunction decon_get_frame_countfunction decon_setup_triggerfunction decon_commitfunction decon_win_set_bldeqfunction decon_win_set_bldmodfunction decon_win_set_pixfmtfunction decon_shadow_protectfunction decon_atomic_beginfunction decon_update_planefunction decon_disable_planefunction decon_atomic_flushfunction decon_swresetfunction decon_atomic_enablefunction decon_atomic_disablefunction decon_te_irq_handlerfunction decon_clear_channelsfunction decon_mode_validfunction decon_bindfunction decon_unbindfunction decon_handle_vblankfunction decon_irq_handlerfunction exynos5433_decon_suspendfunction exynos5433_decon_resumefunction decon_conf_irqfunction exynos5433_decon_probefunction exynos5433_decon_remove
Annotated Snippet
struct decon_context {
struct device *dev;
struct drm_device *drm_dev;
void *dma_priv;
struct exynos_drm_crtc *crtc;
struct exynos_drm_plane planes[WINDOWS_NR];
struct exynos_drm_plane_config configs[WINDOWS_NR];
void __iomem *addr;
struct regmap *sysreg;
struct clk *clks[ARRAY_SIZE(decon_clks_name)];
unsigned int irq;
unsigned int irq_vsync;
unsigned int irq_lcd_sys;
unsigned int te_irq;
unsigned long out_type;
int first_win;
spinlock_t vblank_lock;
u32 frame_id;
};
static const uint32_t decon_formats[] = {
DRM_FORMAT_XRGB1555,
DRM_FORMAT_RGB565,
DRM_FORMAT_XRGB8888,
DRM_FORMAT_ARGB8888,
};
static const enum drm_plane_type decon_win_types[WINDOWS_NR] = {
[PRIMARY_WIN] = DRM_PLANE_TYPE_PRIMARY,
[CURSON_WIN] = DRM_PLANE_TYPE_CURSOR,
};
static const unsigned int capabilities[WINDOWS_NR] = {
0,
EXYNOS_DRM_PLANE_CAP_WIN_BLEND | EXYNOS_DRM_PLANE_CAP_PIX_BLEND,
EXYNOS_DRM_PLANE_CAP_WIN_BLEND | EXYNOS_DRM_PLANE_CAP_PIX_BLEND,
EXYNOS_DRM_PLANE_CAP_WIN_BLEND | EXYNOS_DRM_PLANE_CAP_PIX_BLEND,
EXYNOS_DRM_PLANE_CAP_WIN_BLEND | EXYNOS_DRM_PLANE_CAP_PIX_BLEND,
};
static inline void decon_set_bits(struct decon_context *ctx, u32 reg, u32 mask,
u32 val)
{
val = (val & mask) | (readl(ctx->addr + reg) & ~mask);
writel(val, ctx->addr + reg);
}
static int decon_enable_vblank(struct exynos_drm_crtc *crtc)
{
struct decon_context *ctx = crtc->ctx;
u32 val;
val = VIDINTCON0_INTEN;
if (crtc->i80_mode)
val |= VIDINTCON0_FRAMEDONE;
else
val |= VIDINTCON0_INTFRMEN | VIDINTCON0_FRAMESEL_FP;
writel(val, ctx->addr + DECON_VIDINTCON0);
enable_irq(ctx->irq);
if (!(ctx->out_type & I80_HW_TRG))
enable_irq(ctx->te_irq);
return 0;
}
static void decon_disable_vblank(struct exynos_drm_crtc *crtc)
{
struct decon_context *ctx = crtc->ctx;
if (!(ctx->out_type & I80_HW_TRG))
disable_irq_nosync(ctx->te_irq);
disable_irq_nosync(ctx->irq);
writel(0, ctx->addr + DECON_VIDINTCON0);
}
/* return number of starts/ends of frame transmissions since reset */
static u32 decon_get_frame_count(struct decon_context *ctx, bool end)
{
u32 frm, pfrm, status, cnt = 2;
/* To get consistent result repeat read until frame id is stable.
* Usually the loop will be executed once, in rare cases when the loop
* is executed at frame change time 2nd pass will be needed.
*/
frm = readl(ctx->addr + DECON_CRFMID);
do {
status = readl(ctx->addr + DECON_VIDCON1);
Annotation
- Immediate include surface: `linux/clk.h`, `linux/component.h`, `linux/iopoll.h`, `linux/irq.h`, `linux/mfd/syscon.h`, `linux/of.h`, `linux/platform_device.h`, `linux/pm_runtime.h`.
- Detected declarations: `struct decon_context`, `function decon_set_bits`, `function decon_enable_vblank`, `function decon_disable_vblank`, `function decon_get_frame_count`, `function decon_setup_trigger`, `function decon_commit`, `function decon_win_set_bldeq`, `function decon_win_set_bldmod`, `function decon_win_set_pixfmt`.
- 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.