drivers/gpu/drm/ast/ast_2100.c
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/ast/ast_2100.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/ast/ast_2100.c- Extension
.c- Size
- 13915 bytes
- Lines
- 483
- 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/delay.hlinux/pci.hdrm/drm_drv.hast_drv.hast_post.h
Detected Declarations
function filesfunction mmctestburst2_ast2150function cbrtest_ast2150function cbrscan_ast2150function cbrdlli_ast2150function ast_post_chip_2100function ast_2100_postfunction __ast_2100_detect_wsxga_pfunction __ast_2100_detect_wuxgafunction ast_2100_detect_widescreen
Annotated Snippet
if (++timeout > TIMEOUT_AST2150) {
ast_moutdwm(ast, AST_REG_MCR70, 0x00000000);
return 0xffffffff;
}
} while (!data);
ast_moutdwm(ast, AST_REG_MCR70, 0x00000000);
ast_moutdwm(ast, AST_REG_MCR70, 0x00000003 | (datagen << 3));
timeout = 0;
do {
data = ast_mindwm(ast, AST_REG_MCR70) & 0x40;
if (++timeout > TIMEOUT_AST2150) {
ast_moutdwm(ast, AST_REG_MCR70, 0x00000000);
return 0xffffffff;
}
} while (!data);
data = (ast_mindwm(ast, AST_REG_MCR70) & 0x80) >> 7;
ast_moutdwm(ast, AST_REG_MCR70, 0x00000000);
return data;
}
static int cbrtest_ast2150(struct ast_device *ast)
{
int i;
for (i = 0; i < 8; i++)
if (mmctestburst2_ast2150(ast, i))
return 0;
return 1;
}
static int cbrscan_ast2150(struct ast_device *ast, int busw)
{
u32 patcnt, loop;
for (patcnt = 0; patcnt < CBR_PATNUM_AST2150; patcnt++) {
ast_moutdwm(ast, AST_REG_MCR7C, pattern_AST2150[patcnt]);
for (loop = 0; loop < CBR_PASSNUM_AST2150; loop++) {
if (cbrtest_ast2150(ast))
break;
}
if (loop == CBR_PASSNUM_AST2150)
return 0;
}
return 1;
}
static void cbrdlli_ast2150(struct ast_device *ast, int busw)
{
u32 dll_min[4], dll_max[4], dlli, data, passcnt;
cbr_start:
dll_min[0] = 0xff;
dll_min[1] = 0xff;
dll_min[2] = 0xff;
dll_min[3] = 0xff;
dll_max[0] = 0x00;
dll_max[1] = 0x00;
dll_max[2] = 0x00;
dll_max[3] = 0x00;
passcnt = 0;
for (dlli = 0; dlli < 100; dlli++) {
ast_moutdwm(ast, AST_REG_MCR68, dlli | (dlli << 8) | (dlli << 16) | (dlli << 24));
data = cbrscan_ast2150(ast, busw);
if (data != 0) {
if (data & 0x1) {
if (dll_min[0] > dlli)
dll_min[0] = dlli;
if (dll_max[0] < dlli)
dll_max[0] = dlli;
}
passcnt++;
} else if (passcnt >= CBR_THRESHOLD_AST2150) {
goto cbr_start;
}
}
if (dll_max[0] == 0 || (dll_max[0] - dll_min[0]) < CBR_THRESHOLD_AST2150)
goto cbr_start;
dlli = dll_min[0] + (((dll_max[0] - dll_min[0]) * 7) >> 4);
ast_moutdwm(ast, AST_REG_MCR68, dlli | (dlli << 8) | (dlli << 16) | (dlli << 24));
}
static void ast_post_chip_2100(struct ast_device *ast)
{
u8 j;
u32 i;
enum ast_dram_layout dram_layout = ast_2100_get_dram_layout_p2a(ast);
u32 mcr120;
u32 scu00c, scu040;
Annotation
- Immediate include surface: `linux/delay.h`, `linux/pci.h`, `drm/drm_drv.h`, `ast_drv.h`, `ast_post.h`.
- Detected declarations: `function files`, `function mmctestburst2_ast2150`, `function cbrtest_ast2150`, `function cbrscan_ast2150`, `function cbrdlli_ast2150`, `function ast_post_chip_2100`, `function ast_2100_post`, `function __ast_2100_detect_wsxga_p`, `function __ast_2100_detect_wuxga`, `function ast_2100_detect_widescreen`.
- 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.