drivers/gpu/drm/imx/dc/dc-fg.c
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/imx/dc/dc-fg.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/imx/dc/dc-fg.c- Extension
.c- Size
- 9333 bytes
- Lines
- 377
- 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.
- 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/bitfield.hlinux/bits.hlinux/clk.hlinux/component.hlinux/device.hlinux/jiffies.hlinux/mod_devicetable.hlinux/module.hlinux/platform_device.hlinux/regmap.hlinux/units.hdrm/drm_modes.hdc-de.hdc-drv.h
Detected Declarations
enum dc_fg_syncmodeenum dc_fg_dmfunction dc_fg_enable_shdenfunction dc_fg_syncmodefunction dc_fg_cfg_videomodefunction dc_fg_displaymodefunction dc_fg_panic_displaymodefunction dc_fg_enablefunction dc_fg_disablefunction dc_fg_shdtokgenfunction dc_fg_get_frame_indexfunction dc_fg_get_line_indexfunction dc_fg_wait_for_frame_index_movingfunction dc_fg_secondary_requests_to_read_empty_fifofunction dc_fg_secondary_clear_channel_statusfunction dc_fg_wait_for_secondary_syncupfunction dc_fg_enable_clockfunction dc_fg_disable_clockfunction dc_fg_check_clockfunction dc_fg_initfunction dc_fg_bindfunction dc_fg_probefunction dc_fg_remove
Annotated Snippet
// SPDX-License-Identifier: GPL-2.0+
/*
* Copyright 2024 NXP
*/
#include <linux/bitfield.h>
#include <linux/bits.h>
#include <linux/clk.h>
#include <linux/component.h>
#include <linux/device.h>
#include <linux/jiffies.h>
#include <linux/mod_devicetable.h>
#include <linux/module.h>
#include <linux/platform_device.h>
#include <linux/regmap.h>
#include <linux/units.h>
#include <drm/drm_modes.h>
#include "dc-de.h"
#include "dc-drv.h"
#define FGSTCTRL 0x8
#define FGSYNCMODE_MASK GENMASK(2, 1)
#define FGSYNCMODE(x) FIELD_PREP(FGSYNCMODE_MASK, (x))
#define SHDEN BIT(0)
#define HTCFG1 0xc
#define HTOTAL(x) FIELD_PREP(GENMASK(29, 16), ((x) - 1))
#define HACT(x) FIELD_PREP(GENMASK(13, 0), (x))
#define HTCFG2 0x10
#define HSEN BIT(31)
#define HSBP(x) FIELD_PREP(GENMASK(29, 16), ((x) - 1))
#define HSYNC(x) FIELD_PREP(GENMASK(13, 0), ((x) - 1))
#define VTCFG1 0x14
#define VTOTAL(x) FIELD_PREP(GENMASK(29, 16), ((x) - 1))
#define VACT(x) FIELD_PREP(GENMASK(13, 0), (x))
#define VTCFG2 0x18
#define VSEN BIT(31)
#define VSBP(x) FIELD_PREP(GENMASK(29, 16), ((x) - 1))
#define VSYNC(x) FIELD_PREP(GENMASK(13, 0), ((x) - 1))
#define PKICKCONFIG 0x2c
#define SKICKCONFIG 0x30
#define EN BIT(31)
#define ROW(x) FIELD_PREP(GENMASK(29, 16), (x))
#define COL(x) FIELD_PREP(GENMASK(13, 0), (x))
#define PACFG 0x54
#define SACFG 0x58
#define STARTY(x) FIELD_PREP(GENMASK(29, 16), ((x) + 1))
#define STARTX(x) FIELD_PREP(GENMASK(13, 0), ((x) + 1))
#define FGINCTRL 0x5c
#define FGINCTRLPANIC 0x60
#define ENSECALPHA BIT(4)
#define ENPRIMALPHA BIT(3)
#define FGDM_MASK GENMASK(2, 0)
#define FGCCR 0x64
#define CCGREEN(x) FIELD_PREP(GENMASK(19, 10), (x))
#define FGENABLE 0x68
#define FGEN BIT(0)
#define FGSLR 0x6c
#define SHDTOKGEN BIT(0)
#define FGTIMESTAMP 0x74
#define FRAMEINDEX(x) FIELD_GET(GENMASK(31, 14), (x))
#define LINEINDEX(x) FIELD_GET(GENMASK(13, 0), (x))
#define FGCHSTAT 0x78
#define SECSYNCSTAT BIT(24)
#define SFIFOEMPTY BIT(16)
#define FGCHSTATCLR 0x7c
#define CLRSECSTAT BIT(16)
enum dc_fg_syncmode {
FG_SYNCMODE_OFF, /* No side-by-side synchronization. */
};
enum dc_fg_dm {
FG_DM_CONSTCOL = 0x1, /* Constant Color Background is shown. */
FG_DM_SEC_ON_TOP = 0x5, /* Both inputs overlaid with secondary on top. */
};
Annotation
- Immediate include surface: `linux/bitfield.h`, `linux/bits.h`, `linux/clk.h`, `linux/component.h`, `linux/device.h`, `linux/jiffies.h`, `linux/mod_devicetable.h`, `linux/module.h`.
- Detected declarations: `enum dc_fg_syncmode`, `enum dc_fg_dm`, `function dc_fg_enable_shden`, `function dc_fg_syncmode`, `function dc_fg_cfg_videomode`, `function dc_fg_displaymode`, `function dc_fg_panic_displaymode`, `function dc_fg_enable`, `function dc_fg_disable`, `function dc_fg_shdtokgen`.
- Atlas domain: Driver Families / drivers/gpu.
- 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.