drivers/video/fbdev/i810/i810_main.c
Source file repositories/reference/linux-study-clean/drivers/video/fbdev/i810/i810_main.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/video/fbdev/i810/i810_main.c- Extension
.c- Size
- 59852 bytes
- Lines
- 2235
- 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.
- 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/kernel.hlinux/errno.hlinux/string.hlinux/mm.hlinux/slab.hlinux/fb.hlinux/init.hlinux/pci.hlinux/pci_ids.hlinux/resource.hlinux/unistd.hlinux/console.hlinux/io.hasm/io.hasm/div64.hasm/page.hi810_regs.hi810.hi810_main.h
Detected Declarations
function i810_screen_offfunction i810_dram_offfunction i810_protect_regsfunction i810_load_pllfunction i810_load_vgafunction i810_load_vgaxfunction i810_load_2dfunction i810_hiresfunction i810_load_pitchfunction i810_load_colorfunction i810_load_regsfunction i810_write_dacfunction i810_read_dacfunction i810_restore_pllfunction i810_restore_dacfunction i810_restore_vgaxfunction i810_restore_vgafunction i810_restore_addr_mapfunction i810_restore_2dfunction i810_restore_vga_statefunction i810_save_vgaxfunction i810_save_vgafunction i810_save_2dfunction i810_save_vga_statefunction get_line_lengthfunction i810_calc_dclkfunction i810_enable_cursorfunction i810_reset_cursor_imagefunction i810_load_cursor_imagefunction i810_load_cursor_colorsfunction i810_init_cursorfunction i810_round_offfunction set_color_bitfieldsfunction i810_check_paramsfunction encode_fixfunction decode_varfunction i810fb_getcolregfunction i810fb_openfunction i810fb_releasefunction i810fb_setcolregfunction i810fb_pan_displayfunction i810fb_blankfunction i810fb_set_parfunction i810fb_check_varfunction i810fb_cursorfunction i810fb_suspendfunction i810fb_resumefunction i810_fix_pointers
Annotated Snippet
static struct pci_driver i810fb_driver = {
.name = "i810fb",
.id_table = i810fb_pci_tbl,
.probe = i810fb_init_pci,
.remove = i810fb_remove_pci,
.suspend = i810fb_suspend,
.resume = i810fb_resume,
};
static char *mode_option = NULL;
static int vram = 4;
static int bpp = 8;
static bool mtrr;
static bool accel;
static int hsync1;
static int hsync2;
static int vsync1;
static int vsync2;
static int xres;
static int yres;
static int vyres;
static bool sync;
static bool extvga;
static bool dcolor;
static bool ddc3;
/*------------------------------------------------------------*/
/**************************************************************
* Hardware Low Level Routines *
**************************************************************/
/**
* i810_screen_off - turns off/on display
* @mmio: address of register space
* @mode: on or off
*
* DESCRIPTION:
* Blanks/unblanks the display
*/
static void i810_screen_off(u8 __iomem *mmio, u8 mode)
{
u32 count = WAIT_COUNT;
u8 val;
i810_writeb(SR_INDEX, mmio, SR01);
val = i810_readb(SR_DATA, mmio);
val = (mode == OFF) ? val | SCR_OFF :
val & ~SCR_OFF;
while((i810_readw(DISP_SL, mmio) & 0xFFF) && count--);
i810_writeb(SR_INDEX, mmio, SR01);
i810_writeb(SR_DATA, mmio, val);
}
/**
* i810_dram_off - turns off/on dram refresh
* @mmio: address of register space
* @mode: on or off
*
* DESCRIPTION:
* Turns off DRAM refresh. Must be off for only 2 vsyncs
* before data becomes corrupt
*/
static void i810_dram_off(u8 __iomem *mmio, u8 mode)
{
u8 val;
val = i810_readb(DRAMCH, mmio);
val &= DRAM_OFF;
val = (mode == OFF) ? val : val | DRAM_ON;
i810_writeb(DRAMCH, mmio, val);
}
/**
* i810_protect_regs - allows rw/ro mode of certain VGA registers
* @mmio: address of register space
* @mode: protect/unprotect
*
* DESCRIPTION:
* The IBM VGA standard allows protection of certain VGA registers.
* This will protect or unprotect them.
*/
static void i810_protect_regs(u8 __iomem *mmio, int mode)
{
u8 reg;
i810_writeb(CR_INDEX_CGA, mmio, CR11);
reg = i810_readb(CR_DATA_CGA, mmio);
reg = (mode == OFF) ? reg & ~0x80 :
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/fb.h`.
- Detected declarations: `function i810_screen_off`, `function i810_dram_off`, `function i810_protect_regs`, `function i810_load_pll`, `function i810_load_vga`, `function i810_load_vgax`, `function i810_load_2d`, `function i810_hires`, `function i810_load_pitch`, `function i810_load_color`.
- Atlas domain: Driver Families / drivers/video.
- Implementation status: pattern implementation candidate.
- 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.