drivers/video/fbdev/cirrusfb.c
Source file repositories/reference/linux-study-clean/drivers/video/fbdev/cirrusfb.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/video/fbdev/cirrusfb.c- Extension
.c- Size
- 77130 bytes
- Lines
- 2955
- 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.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/aperture.hlinux/module.hlinux/kernel.hlinux/errno.hlinux/string.hlinux/mm.hlinux/delay.hlinux/fb.hlinux/init.hlinux/zorro.hlinux/pci.hasm/amigahw.hvideo/vga.hvideo/cirrus.h
Detected Declarations
struct zorroclstruct cirrusfb_infoenum cirrus_boardenum cirrusfb_dbg_reg_classfunction Copyrightfunction is_lagunafunction cirrusfb_openfunction cirrusfb_releasefunction cirrusfb_check_mclkfunction cirrusfb_check_pixclockfunction cirrusfb_check_varfunction cirrusfb_set_mclk_as_sourcefunction cirrusfb_set_par_foofunction cirrusfb_set_parfunction cirrusfb_setcolregfunction cirrusfb_pan_displayfunction cirrusfb_blankfunction init_vgachipfunction switch_monitorfunction cirrusfb_syncfunction cirrusfb_fillrectfunction cirrusfb_copyareafunction cirrusfb_imageblitfunction cirrusfb_get_memsizefunction get_pci_addrsfunction cirrusfb_pci_unmapfunction cirrusfb_zorro_unmapfunction cirrusfb_set_fbinfofunction cirrusfb_registerfunction cirrusfb_cleanupfunction cirrusfb_pci_registerfunction cirrusfb_pci_unregisterfunction cirrusfb_zorro_registerfunction cirrusfb_zorro_unregisterfunction cirrusfb_setupfunction cirrusfb_initfunction cirrusfb_exitfunction WGenfunction RGenfunction AttrOnfunction WHDRfunction WSFRfunction WSFR2function WClutfunction RClutfunction cirrusfb_WaitBLTfunction cirrusfb_set_blitterfunction cirrusfb_BitBLT
Annotated Snippet
static struct pci_driver cirrusfb_pci_driver = {
.name = "cirrusfb",
.id_table = cirrusfb_pci_table,
.probe = cirrusfb_pci_register,
.remove = cirrusfb_pci_unregister,
};
#endif /* CONFIG_PCI */
#ifdef CONFIG_ZORRO
static int cirrusfb_zorro_register(struct zorro_dev *z,
const struct zorro_device_id *ent)
{
struct fb_info *info;
int error;
const struct zorrocl *zcl;
enum cirrus_board btype;
unsigned long regbase, ramsize, rambase;
struct cirrusfb_info *cinfo;
info = framebuffer_alloc(sizeof(struct cirrusfb_info), &z->dev);
if (!info)
return -ENOMEM;
zcl = (const struct zorrocl *)ent->driver_data;
btype = zcl->type;
regbase = zorro_resource_start(z) + zcl->regoffset;
ramsize = zcl->ramsize;
if (ramsize) {
rambase = zorro_resource_start(z) + zcl->ramoffset;
if (zorro_resource_len(z) == 64 * MB_) {
/* Quirk for 64 MiB Picasso IV */
rambase += zcl->ramoffset;
}
} else {
struct zorro_dev *ram = zorro_find_device(zcl->ramid, NULL);
if (!ram || !zorro_resource_len(ram)) {
dev_err(info->device, "No video RAM found\n");
error = -ENODEV;
goto err_release_fb;
}
rambase = zorro_resource_start(ram);
ramsize = zorro_resource_len(ram);
if (zcl->ramid2 &&
(ram = zorro_find_device(zcl->ramid2, NULL))) {
if (zorro_resource_start(ram) != rambase + ramsize) {
dev_warn(info->device,
"Skipping non-contiguous RAM at %pR\n",
&ram->resource);
} else {
ramsize += zorro_resource_len(ram);
}
}
}
dev_info(info->device,
"%s board detected, REG at 0x%lx, %lu MiB RAM at 0x%lx\n",
cirrusfb_board_info[btype].name, regbase, ramsize / MB_,
rambase);
if (!zorro_request_device(z, "cirrusfb")) {
dev_err(info->device, "Cannot reserve %pR\n", &z->resource);
error = -EBUSY;
goto err_release_fb;
}
cinfo = info->par;
cinfo->btype = btype;
info->fix.mmio_start = regbase;
cinfo->regbase = regbase > 16 * MB_ ? ioremap(regbase, 64 * 1024)
: ZTWO_VADDR(regbase);
if (!cinfo->regbase) {
dev_err(info->device, "Cannot map registers\n");
error = -EIO;
goto err_release_dev;
}
info->fix.smem_start = rambase;
info->screen_size = ramsize;
info->screen_base = rambase > 16 * MB_ ? ioremap(rambase, ramsize)
: ZTWO_VADDR(rambase);
if (!info->screen_base) {
dev_err(info->device, "Cannot map video RAM\n");
error = -EIO;
goto err_unmap_reg;
}
cinfo->unmap = cirrusfb_zorro_unmap;
dev_info(info->device,
Annotation
- Immediate include surface: `linux/aperture.h`, `linux/module.h`, `linux/kernel.h`, `linux/errno.h`, `linux/string.h`, `linux/mm.h`, `linux/delay.h`, `linux/fb.h`.
- Detected declarations: `struct zorrocl`, `struct cirrusfb_info`, `enum cirrus_board`, `enum cirrusfb_dbg_reg_class`, `function Copyright`, `function is_laguna`, `function cirrusfb_open`, `function cirrusfb_release`, `function cirrusfb_check_mclk`, `function cirrusfb_check_pixclock`.
- Atlas domain: Driver Families / drivers/video.
- Implementation status: pattern 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.