drivers/video/fbdev/pm2fb.c
Source file repositories/reference/linux-study-clean/drivers/video/fbdev/pm2fb.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/video/fbdev/pm2fb.c- Extension
.c- Size
- 50265 bytes
- Lines
- 1855
- 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.
- 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/moduleparam.hlinux/kernel.hlinux/errno.hlinux/string.hlinux/mm.hlinux/slab.hlinux/delay.hlinux/fb.hlinux/init.hlinux/pci.hvideo/permedia2.hvideo/cvisionppc.h
Detected Declarations
struct pm2fb_parfunction pm2_RDfunction pm2_WRfunction pm2_RDAC_RDfunction pm2v_RDAC_RDfunction pm2_RDAC_WRfunction pm2v_RDAC_WRfunction WAIT_FIFOfunction partprodfunction to3264function pm2_mnpfunction pm2v_mnpfunction clear_palettefunction reset_cardfunction reset_configfunction set_aperturefunction set_colorfunction set_memclockfunction set_pixclockfunction set_videofunction pm2fb_check_varfunction pm2fb_set_parfunction pm2fb_setcolregfunction RAMDACfunction Panfunction pm2fb_blankfunction pm2fb_syncfunction pm2fb_fillrectfunction pm2fb_copyareafunction pm2fb_imageblitfunction pm2vfb_cursorfunction pm2fb_cursorfunction pm2fb_probefunction pm2fb_removefunction pm2fb_setupfunction pm2fb_initfunction pm2fb_exitmodule init pm2fb_init
Annotated Snippet
static struct pci_driver pm2fb_driver = {
.name = "pm2fb",
.id_table = pm2fb_id_table,
.probe = pm2fb_probe,
.remove = pm2fb_remove,
};
MODULE_DEVICE_TABLE(pci, pm2fb_id_table);
#ifndef MODULE
/*
* Parse user specified options.
*
* This is, comma-separated options following `video=pm2fb:'.
*/
static int __init pm2fb_setup(char *options)
{
char *this_opt;
if (!options || !*options)
return 0;
while ((this_opt = strsep(&options, ",")) != NULL) {
if (!*this_opt)
continue;
if (!strcmp(this_opt, "lowhsync"))
lowhsync = 1;
else if (!strcmp(this_opt, "lowvsync"))
lowvsync = 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 if (!strncmp(this_opt, "noaccel", 7))
noaccel = 1;
else
mode_option = this_opt;
}
return 0;
}
#endif
static int __init pm2fb_init(void)
{
#ifndef MODULE
char *option = NULL;
#endif
if (fb_modesetting_disabled("pm2fb"))
return -ENODEV;
#ifndef MODULE
if (fb_get_options("pm2fb", &option))
return -ENODEV;
pm2fb_setup(option);
#endif
return pci_register_driver(&pm2fb_driver);
}
module_init(pm2fb_init);
#ifdef MODULE
/*
* Cleanup
*/
static void __exit pm2fb_exit(void)
{
pci_unregister_driver(&pm2fb_driver);
}
#endif
#ifdef MODULE
module_exit(pm2fb_exit);
module_param(mode_option, charp, 0);
MODULE_PARM_DESC(mode_option, "Initial video mode e.g. '648x480-8@60'");
module_param_named(mode, mode_option, charp, 0);
MODULE_PARM_DESC(mode, "Initial video mode e.g. '648x480-8@60' (deprecated)");
module_param(lowhsync, bool, 0);
MODULE_PARM_DESC(lowhsync, "Force horizontal sync low regardless of mode");
module_param(lowvsync, bool, 0);
MODULE_PARM_DESC(lowvsync, "Force vertical sync low regardless of mode");
module_param(noaccel, bool, 0);
MODULE_PARM_DESC(noaccel, "Disable acceleration");
module_param(hwcursor, int, 0644);
MODULE_PARM_DESC(hwcursor, "Enable hardware cursor "
Annotation
- Immediate include surface: `linux/aperture.h`, `linux/module.h`, `linux/moduleparam.h`, `linux/kernel.h`, `linux/errno.h`, `linux/string.h`, `linux/mm.h`, `linux/slab.h`.
- Detected declarations: `struct pm2fb_par`, `function pm2_RD`, `function pm2_WR`, `function pm2_RDAC_RD`, `function pm2v_RDAC_RD`, `function pm2_RDAC_WR`, `function pm2v_RDAC_WR`, `function WAIT_FIFO`, `function partprod`, `function to3264`.
- 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.
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.