drivers/video/fbdev/sis/sis_main.c
Source file repositories/reference/linux-study-clean/drivers/video/fbdev/sis/sis_main.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/video/fbdev/sis/sis_main.c- Extension
.c- Size
- 187584 bytes
- Lines
- 6818
- 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.
- 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/spinlock.hlinux/errno.hlinux/string.hlinux/mm.hlinux/slab.hlinux/fb.hlinux/selection.hlinux/ioport.hlinux/init.hlinux/pci.hlinux/vmalloc.hlinux/capability.hlinux/fs.hlinux/types.hlinux/uaccess.hasm/io.hsis.hsis_main.hinit301.h
Detected Declarations
function sisfb_setdefaultparmsfunction sisfb_search_vesamodefunction sisfb_search_modefunction sisfb_search_crt2typefunction sisfb_search_tvstdfunction sisfb_search_specialtimingfunction sisfb_detect_custom_timingfunction sisfb_interpret_edidfunction sisfb_handle_ddcfunction sisfb_verify_ratefunction sisfb_validate_modefunction sisfb_search_refresh_ratefunction sisfb_bridgeisslavefunction sisfballowretracecrt1function sisfbcheckvretracecrt1function sisfbwaitretracecrt1function sisfbcheckvretracecrt2function sisfb_CheckVBRetracefunction sisfb_setupvbblankflagsfunction sisfb_myblankfunction sisfb_read_nbridge_pci_dwordfunction sisfb_write_nbridge_pci_dwordfunction sisfb_read_lpc_pci_dwordfunction sisfb_write_nbridge_pci_bytefunction sisfb_read_mio_pci_wordfunction sisfb_get_cmap_lenfunction sisfb_set_vparmsfunction sisfb_calc_maxyresfunction sisfb_calc_pitchfunction sisfb_set_pitchfunction sisfb_bpp_to_varfunction sisfb_set_modefunction sisfb_do_set_varfunction sisfb_set_base_CRT1function sisfb_set_base_CRT2function sisfb_pan_varfunction sisfb_openfunction sisfb_releasefunction sisfb_setcolregfunction sisfb_set_parfunction sisfb_check_varfunction sisfb_pan_displayfunction sisfb_blankfunction sisfb_ioctlfunction sisfb_get_fixfunction sisfb_get_dram_sizefunction sisfb_detect_VB_connectfunction sisfb_test_DDC1
Annotated Snippet
static struct pci_driver sisfb_driver = {
.name = "sisfb",
.id_table = sisfb_pci_table,
.probe = sisfb_probe,
.remove = sisfb_remove,
};
static int __init sisfb_init(void)
{
#ifndef MODULE
char *options = NULL;
#endif
if (fb_modesetting_disabled("sisfb"))
return -ENODEV;
#ifndef MODULE
if(fb_get_options("sisfb", &options))
return -ENODEV;
sisfb_setup(options);
#endif
return pci_register_driver(&sisfb_driver);
}
#ifndef MODULE
module_init(sisfb_init);
#endif
/*****************************************************/
/* MODULE */
/*****************************************************/
#ifdef MODULE
static char *mode = NULL;
static int vesa = -1;
static unsigned int rate = 0;
static unsigned int crt1off = 1;
static unsigned int mem = 0;
static char *forcecrt2type = NULL;
static int forcecrt1 = -1;
static int pdc = -1;
static int pdc1 = -1;
static int noaccel = -1;
static int noypan = -1;
static int nomax = -1;
static int userom = -1;
static int useoem = -1;
static char *tvstandard = NULL;
static int nocrt2rate = 0;
static int scalelcd = -1;
static char *specialtiming = NULL;
static int lvdshl = -1;
static int tvxposoffset = 0, tvyposoffset = 0;
#if !defined(__i386__) && !defined(__x86_64__)
static int resetcard = 0;
static int videoram = 0;
#endif
static int __init sisfb_init_module(void)
{
sisfb_setdefaultparms();
if(rate)
sisfb_parm_rate = rate;
if((scalelcd == 0) || (scalelcd == 1))
sisfb_scalelcd = scalelcd ^ 1;
/* Need to check crt2 type first for fstn/dstn */
if(forcecrt2type)
sisfb_search_crt2type(forcecrt2type);
if(tvstandard)
sisfb_search_tvstd(tvstandard);
if(mode)
sisfb_search_mode(mode, false);
else if(vesa != -1)
sisfb_search_vesamode(vesa, false);
sisfb_crt1off = (crt1off == 0) ? 1 : 0;
sisfb_forcecrt1 = forcecrt1;
if(forcecrt1 == 1)
sisfb_crt1off = 0;
else if(forcecrt1 == 0)
sisfb_crt1off = 1;
Annotation
- Immediate include surface: `linux/aperture.h`, `linux/module.h`, `linux/moduleparam.h`, `linux/kernel.h`, `linux/spinlock.h`, `linux/errno.h`, `linux/string.h`, `linux/mm.h`.
- Detected declarations: `function sisfb_setdefaultparms`, `function sisfb_search_vesamode`, `function sisfb_search_mode`, `function sisfb_search_crt2type`, `function sisfb_search_tvstd`, `function sisfb_search_specialtiming`, `function sisfb_detect_custom_timing`, `function sisfb_interpret_edid`, `function sisfb_handle_ddc`, `function sisfb_verify_rate`.
- 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.
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.