drivers/video/fbdev/pm3fb.c
Source file repositories/reference/linux-study-clean/drivers/video/fbdev/pm3fb.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/video/fbdev/pm3fb.c- Extension
.c- Size
- 43200 bytes
- Lines
- 1579
- 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.
- 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/module.hlinux/kernel.hlinux/errno.hlinux/string.hlinux/mm.hlinux/slab.hlinux/delay.hlinux/fb.hlinux/init.hlinux/pci.hvideo/pm3fb.h
Detected Declarations
struct pm3_parfunction PM3_READ_REGfunction PM3_WRITE_REGfunction PM3_WAITfunction PM3_WRITE_DAC_REGfunction pm3fb_set_colorfunction pm3fb_clear_colormapfunction pm3fb_calculate_clockfunction pm3fb_depthfunction pm3fb_shift_bppfunction pm3fb_syncfunction pm3fb_init_enginefunction pm3fb_fillrectfunction pm3fb_copyareafunction pm3fb_imageblitfunction pm3fb_cursorfunction pm3fb_write_modefunction pm3fb_check_varfunction pm3fb_set_parfunction pm3fb_setcolregfunction pm3fb_pan_displayfunction pm3fb_blankfunction pm3fb_size_memoryfunction pm3fb_probefunction pm3fb_removefunction fb_setupfunction pm3fb_initfunction pm3fb_exitmodule init pm3fb_init
Annotated Snippet
static struct pci_driver pm3fb_driver = {
.name = "pm3fb",
.id_table = pm3fb_id_table,
.probe = pm3fb_probe,
.remove = pm3fb_remove,
};
MODULE_DEVICE_TABLE(pci, pm3fb_id_table);
#ifndef MODULE
/*
* Setup
*/
/*
* Only necessary if your driver takes special options,
* otherwise we fall back on the generic fb_setup().
*/
static int __init pm3fb_setup(char *options)
{
char *this_opt;
/* Parse user specified options (`video=pm3fb:') */
if (!options || !*options)
return 0;
while ((this_opt = strsep(&options, ",")) != NULL) {
if (!*this_opt)
continue;
else if (!strncmp(this_opt, "noaccel", 7))
noaccel = 1;
else if (!strncmp(this_opt, "hwcursor=", 9))
hwcursor = simple_strtoul(this_opt + 9, NULL, 0);
else if (!strncmp(this_opt, "nomtrr", 6))
nomtrr = 1;
else
mode_option = this_opt;
}
return 0;
}
#endif /* MODULE */
static int __init pm3fb_init(void)
{
/*
* For kernel boot options (in 'video=pm3fb:<options>' format)
*/
#ifndef MODULE
char *option = NULL;
#endif
if (fb_modesetting_disabled("pm3fb"))
return -ENODEV;
#ifndef MODULE
if (fb_get_options("pm3fb", &option))
return -ENODEV;
pm3fb_setup(option);
#endif
return pci_register_driver(&pm3fb_driver);
}
#ifdef MODULE
static void __exit pm3fb_exit(void)
{
pci_unregister_driver(&pm3fb_driver);
}
module_exit(pm3fb_exit);
#endif
module_init(pm3fb_init);
module_param(mode_option, charp, 0);
MODULE_PARM_DESC(mode_option, "Initial video mode e.g. '648x480-8@60'");
module_param(noaccel, bool, 0);
MODULE_PARM_DESC(noaccel, "Disable acceleration");
module_param(hwcursor, int, 0644);
MODULE_PARM_DESC(hwcursor, "Enable hardware cursor "
"(1=enable, 0=disable, default=1)");
module_param(nomtrr, bool, 0);
MODULE_PARM_DESC(nomtrr, "Disable MTRR support (0 or 1=disabled) (default=0)");
MODULE_DESCRIPTION("Permedia3 framebuffer device driver");
MODULE_LICENSE("GPL");
Annotation
- Immediate include surface: `linux/aperture.h`, `linux/module.h`, `linux/kernel.h`, `linux/errno.h`, `linux/string.h`, `linux/mm.h`, `linux/slab.h`, `linux/delay.h`.
- Detected declarations: `struct pm3_par`, `function PM3_READ_REG`, `function PM3_WRITE_REG`, `function PM3_WAIT`, `function PM3_WRITE_DAC_REG`, `function pm3fb_set_color`, `function pm3fb_clear_colormap`, `function pm3fb_calculate_clock`, `function pm3fb_depth`, `function pm3fb_shift_bpp`.
- 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.