drivers/video/fbdev/tdfxfb.c
Source file repositories/reference/linux-study-clean/drivers/video/fbdev/tdfxfb.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/video/fbdev/tdfxfb.c- Extension
.c- Size
- 44070 bytes
- Lines
- 1673
- 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.
- 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.hasm/io.hvideo/tdfx.hvideo/vga.h
Detected Declarations
function vga_inbfunction vga_outbfunction gra_outbfunction seq_outbfunction seq_inbfunction crt_outbfunction crt_inbfunction att_outbfunction vga_disable_videofunction vga_enable_videofunction vga_enable_palettefunction tdfx_inlfunction tdfx_outlfunction banshee_make_roomfunction banshee_wait_idlefunction do_setpalentryfunction do_calc_pllfunction do_write_regsfunction do_lfb_sizefunction tdfxfb_check_varfunction tdfxfb_set_parfunction tdfxfb_setcolregfunction tdfxfb_blankfunction tdfxfb_pan_displayfunction commandfunction tdfxfb_copyareafunction tdfxfb_imageblitfunction tdfxfb_cursorfunction tdfxfb_i2c_setsclfunction tdfxfb_i2c_setsdafunction tdfxfb_i2c_getsclfunction tdfxfb_i2c_getsdafunction tdfxfb_ddc_setsclfunction tdfxfb_ddc_setsdafunction tdfxfb_ddc_getsclfunction tdfxfb_ddc_getsdafunction tdfxfb_setup_ddc_busfunction tdfxfb_setup_i2c_busfunction tdfxfb_create_i2c_bussesfunction tdfxfb_delete_i2c_bussesfunction tdfxfb_probe_i2c_connectorfunction tdfxfb_probefunction tdfxfb_setupfunction tdfxfb_removefunction tdfxfb_initfunction tdfxfb_exitmodule init tdfxfb_init
Annotated Snippet
static struct pci_driver tdfxfb_driver = {
.name = "tdfxfb",
.id_table = tdfxfb_id_table,
.probe = tdfxfb_probe,
.remove = tdfxfb_remove,
};
MODULE_DEVICE_TABLE(pci, tdfxfb_id_table);
/*
* Driver data
*/
static int nopan;
static int nowrap = 1; /* not implemented (yet) */
static int hwcursor = 1;
static char *mode_option;
static bool nomtrr;
/* -------------------------------------------------------------------------
* Hardware-specific funcions
* ------------------------------------------------------------------------- */
static inline u8 vga_inb(struct tdfx_par *par, u32 reg)
{
return inb(par->iobase + reg - 0x300);
}
static inline void vga_outb(struct tdfx_par *par, u32 reg, u8 val)
{
outb(val, par->iobase + reg - 0x300);
}
static inline void gra_outb(struct tdfx_par *par, u32 idx, u8 val)
{
vga_outb(par, GRA_I, idx);
wmb();
vga_outb(par, GRA_D, val);
wmb();
}
static inline void seq_outb(struct tdfx_par *par, u32 idx, u8 val)
{
vga_outb(par, SEQ_I, idx);
wmb();
vga_outb(par, SEQ_D, val);
wmb();
}
static inline u8 seq_inb(struct tdfx_par *par, u32 idx)
{
vga_outb(par, SEQ_I, idx);
mb();
return vga_inb(par, SEQ_D);
}
static inline void crt_outb(struct tdfx_par *par, u32 idx, u8 val)
{
vga_outb(par, CRT_I, idx);
wmb();
vga_outb(par, CRT_D, val);
wmb();
}
static inline u8 crt_inb(struct tdfx_par *par, u32 idx)
{
vga_outb(par, CRT_I, idx);
mb();
return vga_inb(par, CRT_D);
}
static inline void att_outb(struct tdfx_par *par, u32 idx, u8 val)
{
vga_inb(par, IS1_R);
vga_outb(par, ATT_IW, idx);
vga_outb(par, ATT_IW, val);
}
static inline void vga_disable_video(struct tdfx_par *par)
{
unsigned char s;
s = seq_inb(par, 0x01) | 0x20;
seq_outb(par, 0x00, 0x01);
seq_outb(par, 0x01, s);
seq_outb(par, 0x00, 0x03);
}
static inline void vga_enable_video(struct tdfx_par *par)
{
unsigned char s;
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 vga_inb`, `function vga_outb`, `function gra_outb`, `function seq_outb`, `function seq_inb`, `function crt_outb`, `function crt_inb`, `function att_outb`, `function vga_disable_video`, `function vga_enable_video`.
- 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.