drivers/video/fbdev/aty/atyfb_base.c
Source file repositories/reference/linux-study-clean/drivers/video/fbdev/aty/atyfb_base.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/video/fbdev/aty/atyfb_base.c- Extension
.c- Size
- 111408 bytes
- Lines
- 4024
- Domain
- Driver Families
- Bucket
- drivers/video
- Inferred role
- Driver Families: operation-table or driver-model contract
- Status
- pattern 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 an operation table; this is where Linux turns generic core objects into subsystem-specific behavior.
- Touches user memory; correctness depends on fault-safe copying and privilege boundary handling.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- Touches IRQ or DMA behavior; this matters for the representative real-device path.
- 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/aperture.hlinux/compat.hlinux/module.hlinux/moduleparam.hlinux/kernel.hlinux/errno.hlinux/string.hlinux/mm.hlinux/slab.hlinux/vmalloc.hlinux/delay.hlinux/compiler.hlinux/console.hlinux/fb.hlinux/init.hlinux/pci.hlinux/interrupt.hlinux/spinlock.hlinux/wait.hlinux/backlight.hlinux/reboot.hlinux/dmi.hasm/io.hlinux/uaccess.hvideo/mach64.hatyfb.hati_ids.hasm/machdep.h../macmodes.hasm/fbio.hasm/oplib.hasm/prom.h
Detected Declarations
struct pci_mmap_mapstruct atyclkfunction aty_st_lcdfunction aty_ld_lcdfunction definedfunction definedfunction atyfb_compat_ioctlfunction MBfunction correct_chipsetfunction atyfb_get_pixclockfunction read_aty_sensefunction aty_get_crtcfunction aty_set_crtcfunction calc_line_lengthfunction aty_var_to_crtcfunction aty_crtc_to_varfunction atyfb_set_parfunction atyfb_check_varfunction set_off_pitchfunction atyfb_openfunction aty_irqfunction aty_enable_irqfunction aty_disable_irqfunction atyfb_releasefunction atyfb_pan_displayfunction aty_waitforvblankfunction atyfb_ioctlfunction atyfb_syncfunction atyfb_mmapfunction aty_power_mgmtfunction atyfb_pci_suspend_latefunction atyfb_pci_suspendfunction atyfb_pci_hibernatefunction atyfb_pci_freezefunction aty_resume_chipfunction atyfb_pci_resumefunction aty_bl_get_level_brightnessfunction aty_bl_update_statusfunction aty_bl_initfunction aty_bl_exitfunction aty_calc_mem_refreshfunction atyfb_get_timings_from_lcdfunction aty_initfunction store_video_parfunction atyfb_blankfunction aty_st_palfunction atyfb_setcolregfunction atyfb_setup_sparc
Annotated Snippet
static struct pci_driver atyfb_driver = {
.name = "atyfb",
.id_table = atyfb_pci_tbl,
.probe = atyfb_pci_probe,
.remove = atyfb_pci_remove,
.driver.pm = &atyfb_pci_pm_ops,
};
#endif /* CONFIG_PCI */
#ifndef MODULE
static int __init atyfb_setup(char *options)
{
char *this_opt;
if (!options || !*options)
return 0;
while ((this_opt = strsep(&options, ",")) != NULL) {
if (!strncmp(this_opt, "noaccel", 7)) {
noaccel = true;
} else if (!strncmp(this_opt, "nomtrr", 6)) {
nomtrr = true;
} else if (!strncmp(this_opt, "vram:", 5))
vram = simple_strtoul(this_opt + 5, NULL, 0);
else if (!strncmp(this_opt, "pll:", 4))
pll = simple_strtoul(this_opt + 4, NULL, 0);
else if (!strncmp(this_opt, "mclk:", 5))
mclk = simple_strtoul(this_opt + 5, NULL, 0);
else if (!strncmp(this_opt, "xclk:", 5))
xclk = simple_strtoul(this_opt+5, NULL, 0);
else if (!strncmp(this_opt, "comp_sync:", 10))
comp_sync = simple_strtoul(this_opt+10, NULL, 0);
else if (!strncmp(this_opt, "backlight:", 10))
backlight = simple_strtoul(this_opt+10, NULL, 0);
#ifdef CONFIG_PPC
else if (!strncmp(this_opt, "vmode:", 6)) {
unsigned int vmode =
simple_strtoul(this_opt + 6, NULL, 0);
if (vmode > 0 && vmode <= VMODE_MAX)
default_vmode = vmode;
} else if (!strncmp(this_opt, "cmode:", 6)) {
unsigned int cmode =
simple_strtoul(this_opt + 6, NULL, 0);
switch (cmode) {
case 0:
case 8:
default_cmode = CMODE_8;
break;
case 15:
case 16:
default_cmode = CMODE_16;
break;
case 24:
case 32:
default_cmode = CMODE_32;
break;
}
}
#endif
#ifdef CONFIG_ATARI
/*
* Why do we need this silly Mach64 argument?
* We are already here because of mach64= so its redundant.
*/
else if (MACH_IS_ATARI
&& (!strncmp(this_opt, "Mach64:", 7))) {
static unsigned char m64_num;
static char mach64_str[80];
strscpy(mach64_str, this_opt + 7, sizeof(mach64_str));
if (!store_video_par(mach64_str, m64_num)) {
m64_num++;
mach64_count = m64_num;
}
}
#endif
else
mode = this_opt;
}
return 0;
}
#endif /* MODULE */
static int atyfb_reboot_notify(struct notifier_block *nb,
unsigned long code, void *unused)
{
struct atyfb_par *par;
if (code != SYS_RESTART)
return NOTIFY_DONE;
Annotation
- Immediate include surface: `linux/aperture.h`, `linux/compat.h`, `linux/module.h`, `linux/moduleparam.h`, `linux/kernel.h`, `linux/errno.h`, `linux/string.h`, `linux/mm.h`.
- Detected declarations: `struct pci_mmap_map`, `struct atyclk`, `function aty_st_lcd`, `function aty_ld_lcd`, `function defined`, `function defined`, `function atyfb_compat_ioctl`, `function MB`, `function correct_chipset`, `function atyfb_get_pixclock`.
- Atlas domain: Driver Families / drivers/video.
- Implementation status: pattern implementation candidate.
- This snippet crosses the user/kernel memory boundary; validate fault handling and access checks before translating the pattern.
- Synchronization appears in or near this file; preserve lock ordering, sleepability, and interrupt-context constraints.
- IRQ or DMA behavior appears here, which is relevant to the selected PCIe/NVMe device path.
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.