drivers/video/fbdev/pvr2fb.c
Source file repositories/reference/linux-study-clean/drivers/video/fbdev/pvr2fb.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/video/fbdev/pvr2fb.c- Extension
.c- Size
- 31012 bytes
- Lines
- 1150
- 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 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/module.hlinux/kernel.hlinux/errno.hlinux/string.hlinux/mm.hlinux/slab.hlinux/delay.hlinux/interrupt.hlinux/fb.hlinux/init.hlinux/pci.hasm/machvec.hmach-dreamcast/mach/sysasic.hlinux/pagemap.hmach/dma.hasm/dma.hlinux/uaccess.hcpu/sq.h
Detected Declarations
struct pvr2_paramsfunction pvr2fb_set_pal_typefunction pvr2fb_set_pal_entryfunction pvr2fb_blankfunction get_line_lengthfunction set_color_bitfieldsfunction pvr2fb_setcolregfunction overiddenfunction pvr2fb_set_parfunction pvr2fb_check_varfunction pvr2_update_displayfunction pvr2_init_displayfunction pvr2_do_blankfunction pvr2fb_interruptfunction pvr2fb_writefunction pvr2_get_param_valfunction pvr2fb_common_initfunction pvr2fb_dc_initfunction pvr2fb_dc_exitfunction pvr2fb_pci_probefunction pvr2fb_pci_removefunction pvr2fb_pci_initfunction pvr2fb_pci_exitfunction pvr2fb_setupfunction pvr2fb_initfunction pvr2fb_exitmodule init pvr2fb_init
Annotated Snippet
static struct pci_driver pvr2fb_pci_driver = {
.name = "pvr2fb",
.id_table = pvr2fb_pci_tbl,
.probe = pvr2fb_pci_probe,
.remove = pvr2fb_pci_remove,
};
static int __init pvr2fb_pci_init(void)
{
return pci_register_driver(&pvr2fb_pci_driver);
}
static void pvr2fb_pci_exit(void)
{
pci_unregister_driver(&pvr2fb_pci_driver);
}
#endif /* CONFIG_PCI */
/*
* Parse command arguments. Supported arguments are:
* inverse Use inverse color maps
* cable:composite|rgb|vga Override the video cable type
* output:NTSC|PAL|VGA Override the video output format
*
* <xres>x<yres>[-<bpp>][@<refresh>] or,
* <name>[-<bpp>][@<refresh>] Startup using this video mode
*/
#ifndef MODULE
static int __init pvr2fb_setup(char *options)
{
char *this_opt;
char cable_arg[80];
char output_arg[80];
if (!options || !*options)
return 0;
cable_arg[0] = output_arg[0] = 0;
while ((this_opt = strsep(&options, ","))) {
if (!*this_opt)
continue;
if (!strcmp(this_opt, "inverse")) {
fb_invert_cmaps();
} else if (!strncmp(this_opt, "cable:", 6)) {
strcpy(cable_arg, this_opt + 6);
} else if (!strncmp(this_opt, "output:", 7)) {
strcpy(output_arg, this_opt + 7);
} else if (!strncmp(this_opt, "nopan", 5)) {
nopan = 1;
} else if (!strncmp(this_opt, "nowrap", 6)) {
nowrap = 1;
} else {
mode_option = this_opt;
}
}
if (*cable_arg)
cable_type = pvr2_get_param_val(cables, cable_arg, 3);
if (*output_arg)
video_output = pvr2_get_param_val(outputs, output_arg, 3);
return 0;
}
#endif
static struct pvr2_board {
int (*init)(void);
void (*exit)(void);
char name[16];
} board_driver[] __refdata = {
#ifdef CONFIG_SH_DREAMCAST
{ pvr2fb_dc_init, pvr2fb_dc_exit, "Sega DC PVR2" },
#endif
#ifdef CONFIG_PCI
{ pvr2fb_pci_init, pvr2fb_pci_exit, "PCI PVR2" },
#endif
{ 0, },
};
static int __init pvr2fb_init(void)
{
int i, ret = -ENODEV;
#ifndef MODULE
char *option = NULL;
#endif
if (fb_modesetting_disabled("pvr2fb"))
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 pvr2_params`, `function pvr2fb_set_pal_type`, `function pvr2fb_set_pal_entry`, `function pvr2fb_blank`, `function get_line_length`, `function set_color_bitfields`, `function pvr2fb_setcolreg`, `function overidden`, `function pvr2fb_set_par`, `function pvr2fb_check_var`.
- Atlas domain: Driver Families / drivers/video.
- Implementation status: pattern implementation candidate.
- 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.