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.

Dependency Surface

Detected Declarations

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

Implementation Notes