drivers/gpu/drm/imx/dc/dc-fu.c
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/imx/dc/dc-fu.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/imx/dc/dc-fu.c- Extension
.c- Size
- 7028 bytes
- Lines
- 259
- 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.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/bitfield.hlinux/bitops.hlinux/bits.hlinux/math.hdc-fu.hdc-pe.h
Detected Declarations
struct dc_fu_pixel_formatenum dc_linemodefunction dc_fu_get_pixel_format_bitsfunction dc_fu_get_pixel_format_shiftsfunction dc_fu_enable_shdenfunction dc_fu_baddr_autoupdatefunction dc_fu_shdldreq_stickyfunction dc_fu_set_linemodefunction dc_fu_set_numbuffersfunction dc_fu_set_burstlengthfunction dc_fu_set_baseaddressfunction dc_fu_set_src_bppfunction dc_fu_set_src_stridefunction dc_fu_set_src_buf_dimensionsfunction dc_fu_layeroffsetfunction dc_fu_clipoffsetfunction dc_fu_clipdimensionsfunction dc_fu_set_pixel_blend_modefunction dc_fu_enable_src_buffunction dc_fu_disable_src_buffunction dc_fu_set_layerblendfunction dc_fu_get_link_idfunction dc_fu_common_hw_init
Annotated Snippet
struct dc_fu_pixel_format {
u32 pixel_format;
u32 bits;
u32 shifts;
};
static const struct dc_fu_pixel_format pixel_formats[] = {
{
DRM_FORMAT_XRGB8888,
R_BITS(8) | G_BITS(8) | B_BITS(8) | A_BITS(0),
R_SHIFT(16) | G_SHIFT(8) | B_SHIFT(0) | A_SHIFT(0),
},
};
void dc_fu_get_pixel_format_bits(struct dc_fu *fu, u32 format, u32 *bits)
{
int i;
for (i = 0; i < ARRAY_SIZE(pixel_formats); i++) {
if (pixel_formats[i].pixel_format == format) {
*bits = pixel_formats[i].bits;
return;
}
}
}
void
dc_fu_get_pixel_format_shifts(struct dc_fu *fu, u32 format, u32 *shifts)
{
int i;
for (i = 0; i < ARRAY_SIZE(pixel_formats); i++) {
if (pixel_formats[i].pixel_format == format) {
*shifts = pixel_formats[i].shifts;
return;
}
}
}
static inline void dc_fu_enable_shden(struct dc_fu *fu)
{
regmap_write_bits(fu->reg_cfg, STATICCONTROL, SHDEN, SHDEN);
}
static inline void dc_fu_baddr_autoupdate(struct dc_fu *fu, u8 layer_mask)
{
regmap_write_bits(fu->reg_cfg, STATICCONTROL,
BASEADDRESSAUTOUPDATE_MASK,
BASEADDRESSAUTOUPDATE(layer_mask));
}
void dc_fu_shdldreq_sticky(struct dc_fu *fu, u8 layer_mask)
{
regmap_write_bits(fu->reg_cfg, STATICCONTROL, SHDLDREQSTICKY_MASK,
SHDLDREQSTICKY(layer_mask));
}
static inline void dc_fu_set_linemode(struct dc_fu *fu, enum dc_linemode mode)
{
regmap_write_bits(fu->reg_cfg, BURSTBUFFERMANAGEMENT, LINEMODE_MASK,
mode);
}
static inline void dc_fu_set_numbuffers(struct dc_fu *fu, unsigned int num)
{
regmap_write_bits(fu->reg_cfg, BURSTBUFFERMANAGEMENT,
SETNUMBUFFERS_MASK, SETNUMBUFFERS(num));
}
static void dc_fu_set_burstlength(struct dc_fu *fu, dma_addr_t baddr)
{
unsigned int burst_size, burst_length;
burst_size = 1 << __ffs(baddr);
burst_size = round_up(burst_size, 8);
burst_size = min(burst_size, 128U);
burst_length = burst_size / 8;
regmap_write_bits(fu->reg_cfg, BURSTBUFFERMANAGEMENT,
SETBURSTLENGTH_MASK, SETBURSTLENGTH(burst_length));
}
static void dc_fu_set_baseaddress(struct dc_fu *fu, enum dc_fu_frac frac,
dma_addr_t baddr)
{
regmap_write(fu->reg_cfg, fu->reg_baseaddr[frac], baddr);
}
void dc_fu_set_src_bpp(struct dc_fu *fu, enum dc_fu_frac frac, unsigned int bpp)
{
Annotation
- Immediate include surface: `linux/bitfield.h`, `linux/bitops.h`, `linux/bits.h`, `linux/math.h`, `dc-fu.h`, `dc-pe.h`.
- Detected declarations: `struct dc_fu_pixel_format`, `enum dc_linemode`, `function dc_fu_get_pixel_format_bits`, `function dc_fu_get_pixel_format_shifts`, `function dc_fu_enable_shden`, `function dc_fu_baddr_autoupdate`, `function dc_fu_shdldreq_sticky`, `function dc_fu_set_linemode`, `function dc_fu_set_numbuffers`, `function dc_fu_set_burstlength`.
- 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.