drivers/gpu/drm/imx/dc/dc-fl.c
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/imx/dc/dc-fl.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/imx/dc/dc-fl.c- Extension
.c- Size
- 4937 bytes
- Lines
- 186
- 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/component.hlinux/ioport.hlinux/mod_devicetable.hlinux/module.hlinux/platform_device.hlinux/regmap.hdrm/drm_fourcc.hdc-drv.hdc-fu.h
Detected Declarations
struct dc_flfunction dc_fl_set_fmtfunction dc_fl_set_framedimensionsfunction dc_fl_initfunction dc_fl_set_opsfunction dc_fl_bindfunction dc_fl_probefunction dc_fl_remove
Annotated Snippet
struct dc_fl {
struct dc_fu fu;
};
static const struct dc_subdev_info dc_fl_info[] = {
{ .reg_start = 0x56180ac0, .id = 0, },
};
static const struct regmap_range dc_fl_regmap_ranges[] = {
regmap_reg_range(STATICCONTROL, FRAMEDIMENSIONS),
};
static const struct regmap_access_table dc_fl_regmap_access_table = {
.yes_ranges = dc_fl_regmap_ranges,
.n_yes_ranges = ARRAY_SIZE(dc_fl_regmap_ranges),
};
static const struct regmap_config dc_fl_cfg_regmap_config = {
.name = "cfg",
.reg_bits = 32,
.reg_stride = 4,
.val_bits = 32,
.fast_io = true,
.wr_table = &dc_fl_regmap_access_table,
.rd_table = &dc_fl_regmap_access_table,
.max_register = FRAMEDIMENSIONS,
};
static void dc_fl_set_fmt(struct dc_fu *fu, enum dc_fu_frac frac,
const struct drm_format_info *format)
{
u32 bits = 0, shifts = 0;
dc_fu_set_src_bpp(fu, frac, format->cpp[0] * 8);
regmap_write_bits(fu->reg_cfg, LAYERPROPERTY(frac),
YUVCONVERSIONMODE_MASK,
YUVCONVERSIONMODE(YUVCONVERSIONMODE_OFF));
dc_fu_get_pixel_format_bits(fu, format->format, &bits);
dc_fu_get_pixel_format_shifts(fu, format->format, &shifts);
regmap_write(fu->reg_cfg, COLORCOMPONENTBITS(frac), bits);
regmap_write(fu->reg_cfg, COLORCOMPONENTSHIFT(frac), shifts);
}
static void dc_fl_set_framedimensions(struct dc_fu *fu, int w, int h)
{
regmap_write(fu->reg_cfg, FRAMEDIMENSIONS,
FRAMEWIDTH(w) | FRAMEHEIGHT(h));
}
static void dc_fl_init(struct dc_fu *fu)
{
dc_fu_common_hw_init(fu);
dc_fu_shdldreq_sticky(fu, 0xff);
}
static void dc_fl_set_ops(struct dc_fu *fu)
{
memcpy(&fu->ops, &dc_fu_common_ops, sizeof(dc_fu_common_ops));
fu->ops.init = dc_fl_init;
fu->ops.set_fmt = dc_fl_set_fmt;
fu->ops.set_framedimensions = dc_fl_set_framedimensions;
}
static int dc_fl_bind(struct device *dev, struct device *master, void *data)
{
struct platform_device *pdev = to_platform_device(dev);
struct dc_drm_device *dc_drm = data;
struct resource *res_pec;
void __iomem *base_cfg;
struct dc_fl *fl;
struct dc_fu *fu;
int i, id;
fl = devm_kzalloc(dev, sizeof(*fl), GFP_KERNEL);
if (!fl)
return -ENOMEM;
fu = &fl->fu;
res_pec = platform_get_resource(pdev, IORESOURCE_MEM, 0);
base_cfg = devm_platform_ioremap_resource_byname(pdev, "cfg");
if (IS_ERR(base_cfg))
return PTR_ERR(base_cfg);
fu->reg_cfg = devm_regmap_init_mmio(dev, base_cfg,
&dc_fl_cfg_regmap_config);
Annotation
- Immediate include surface: `linux/component.h`, `linux/ioport.h`, `linux/mod_devicetable.h`, `linux/module.h`, `linux/platform_device.h`, `linux/regmap.h`, `drm/drm_fourcc.h`, `dc-drv.h`.
- Detected declarations: `struct dc_fl`, `function dc_fl_set_fmt`, `function dc_fl_set_framedimensions`, `function dc_fl_init`, `function dc_fl_set_ops`, `function dc_fl_bind`, `function dc_fl_probe`, `function dc_fl_remove`.
- 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.