drivers/gpu/drm/exynos/exynos7_drm_decon.c
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/exynos/exynos7_drm_decon.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/exynos/exynos7_drm_decon.c- Extension
.c- Size
- 21415 bytes
- Lines
- 853
- 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/of.hlinux/of_address.hlinux/platform_device.hlinux/pm_runtime.hvideo/of_display_timing.hvideo/of_videomode.hdrm/drm_fourcc.hdrm/drm_framebuffer.hdrm/drm_print.hdrm/drm_vblank.hdrm/exynos_drm.hexynos_drm_crtc.hexynos_drm_drv.hexynos_drm_fb.hexynos_drm_plane.hregs-decon7.h
Detected Declarations
struct decon_datastruct decon_contextfunction decon_shadow_protect_winfunction decon_wait_for_vblankfunction decon_clear_channelsfunction decon_ctx_initializefunction decon_ctx_removefunction decon_calc_clkdivfunction decon_commitfunction decon_enable_vblankfunction decon_disable_vblankfunction decon_win_set_pixfmtfunction decon_win_set_colkeyfunction decon_atomic_beginfunction decon_update_planefunction decon_disable_planefunction decon_atomic_flushfunction decon_initfunction decon_atomic_enablefunction decon_atomic_disablefunction decon_irq_handlerfunction decon_bindfunction decon_unbindfunction decon_probefunction decon_removefunction exynos7_decon_suspendfunction exynos7_decon_resume
Annotated Snippet
struct decon_data {
unsigned int vidw_buf_start_base;
unsigned int shadowcon_win_protect_shift;
unsigned int wincon_burstlen_shift;
};
static const struct decon_data exynos7_decon_data = {
.vidw_buf_start_base = 0x80,
.shadowcon_win_protect_shift = 10,
.wincon_burstlen_shift = 11,
};
static const struct decon_data exynos7870_decon_data = {
.vidw_buf_start_base = 0x880,
.shadowcon_win_protect_shift = 8,
.wincon_burstlen_shift = 10,
};
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];
struct clk *pclk;
struct clk *aclk;
struct clk *eclk;
struct clk *vclk;
void __iomem *regs;
unsigned long irq_flags;
bool i80_if;
wait_queue_head_t wait_vsync_queue;
atomic_t wait_vsync_event;
const struct decon_data *data;
struct drm_encoder *encoder;
};
static const struct of_device_id decon_driver_dt_match[] = {
{
.compatible = "samsung,exynos7-decon",
.data = &exynos7_decon_data,
},
{
.compatible = "samsung,exynos7870-decon",
.data = &exynos7870_decon_data,
},
{},
};
MODULE_DEVICE_TABLE(of, decon_driver_dt_match);
static const uint32_t decon_formats[] = {
DRM_FORMAT_RGB565,
DRM_FORMAT_XRGB8888,
DRM_FORMAT_XBGR8888,
DRM_FORMAT_RGBX8888,
DRM_FORMAT_BGRX8888,
DRM_FORMAT_ARGB8888,
DRM_FORMAT_ABGR8888,
DRM_FORMAT_RGBA8888,
DRM_FORMAT_BGRA8888,
};
static const enum drm_plane_type decon_win_types[WINDOWS_NR] = {
DRM_PLANE_TYPE_PRIMARY,
DRM_PLANE_TYPE_CURSOR,
};
/**
* decon_shadow_protect_win() - disable updating values from shadow registers at vsync
*
* @ctx: display and enhancement controller context
* @win: window to protect registers for
* @protect: 1 to protect (disable updates)
*/
static void decon_shadow_protect_win(struct decon_context *ctx,
unsigned int win, bool protect)
{
u32 bits, val;
unsigned int shift = ctx->data->shadowcon_win_protect_shift;
bits = SHADOWCON_WINx_PROTECT(shift, win);
val = readl(ctx->regs + SHADOWCON);
if (protect)
val |= bits;
else
val &= ~bits;
writel(val, ctx->regs + SHADOWCON);
Annotation
- Immediate include surface: `linux/clk.h`, `linux/component.h`, `linux/kernel.h`, `linux/of.h`, `linux/of_address.h`, `linux/platform_device.h`, `linux/pm_runtime.h`, `video/of_display_timing.h`.
- Detected declarations: `struct decon_data`, `struct decon_context`, `function decon_shadow_protect_win`, `function decon_wait_for_vblank`, `function decon_clear_channels`, `function decon_ctx_initialize`, `function decon_ctx_remove`, `function decon_calc_clkdiv`, `function decon_commit`, `function decon_enable_vblank`.
- 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.