drivers/video/fbdev/tgafb.c
Source file repositories/reference/linux-study-clean/drivers/video/fbdev/tgafb.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/video/fbdev/tgafb.c- Extension
.c- Size
- 43662 bytes
- Lines
- 1630
- 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.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/aperture.hlinux/bitrev.hlinux/compiler.hlinux/delay.hlinux/device.hlinux/errno.hlinux/fb.hlinux/init.hlinux/ioport.hlinux/kernel.hlinux/mm.hlinux/module.hlinux/pci.hlinux/selection.hlinux/string.hlinux/tc.hasm/io.hvideo/tgafb.h
Detected Declarations
function tgafb_pci_registerfunction tgafb_pci_unregisterfunction tgafb_tc_registerfunction tgafb_tc_unregisterfunction tgafb_check_varfunction tgafb_set_parfunction tgafb_set_pllfunction tgafb_setcolregfunction tgafb_blankfunction tgafb_mono_imageblitfunction tgafb_clut_imageblitfunction tgafb_imageblitfunction tgafb_fillrectfunction copyarea_line_8bppfunction copyarea_line_32bppfunction copyarea_8bppfunction tgafb_copyareafunction tgafb_init_fixfunction fb_set_logo_truepalettefunction tgafb_pan_displayfunction tgafb_registerfunction tgafb_unregisterfunction tgafb_exitfunction tgafb_setupfunction tgafb_initmodule init tgafb_init
Annotated Snippet
static struct pci_driver tgafb_pci_driver;
static struct tc_driver tgafb_tc_driver;
/*
* Frame buffer operations
*/
static const struct fb_ops tgafb_ops = {
.owner = THIS_MODULE,
__FB_DEFAULT_IOMEM_OPS_RDWR,
.fb_check_var = tgafb_check_var,
.fb_set_par = tgafb_set_par,
.fb_setcolreg = tgafb_setcolreg,
.fb_blank = tgafb_blank,
.fb_pan_display = tgafb_pan_display,
.fb_fillrect = tgafb_fillrect,
.fb_copyarea = tgafb_copyarea,
.fb_imageblit = tgafb_imageblit,
__FB_DEFAULT_IOMEM_OPS_MMAP,
};
#ifdef CONFIG_PCI
/*
* PCI registration operations
*/
static int tgafb_pci_register(struct pci_dev *, const struct pci_device_id *);
static void tgafb_pci_unregister(struct pci_dev *);
static struct pci_device_id const tgafb_pci_table[] = {
{ PCI_DEVICE(PCI_VENDOR_ID_DEC, PCI_DEVICE_ID_DEC_TGA) },
{ }
};
MODULE_DEVICE_TABLE(pci, tgafb_pci_table);
static struct pci_driver tgafb_pci_driver = {
.name = "tgafb",
.id_table = tgafb_pci_table,
.probe = tgafb_pci_register,
.remove = tgafb_pci_unregister,
};
static int tgafb_pci_register(struct pci_dev *pdev,
const struct pci_device_id *ent)
{
int ret;
ret = aperture_remove_conflicting_pci_devices(pdev, "tgafb");
if (ret)
return ret;
return tgafb_register(&pdev->dev);
}
static void tgafb_pci_unregister(struct pci_dev *pdev)
{
tgafb_unregister(&pdev->dev);
}
#endif /* CONFIG_PCI */
#ifdef CONFIG_TC
/*
* TC registration operations
*/
static int tgafb_tc_register(struct device *);
static int tgafb_tc_unregister(struct device *);
static struct tc_device_id const tgafb_tc_table[] = {
{ "DEC ", "PMAGD-AA" },
{ "DEC ", "PMAGD " },
{ }
};
MODULE_DEVICE_TABLE(tc, tgafb_tc_table);
static struct tc_driver tgafb_tc_driver = {
.id_table = tgafb_tc_table,
.driver = {
.name = "tgafb",
.bus = &tc_bus_type,
.probe = tgafb_tc_register,
.remove = tgafb_tc_unregister,
},
};
static int tgafb_tc_register(struct device *dev)
{
int status = tgafb_register(dev);
if (!status)
get_device(dev);
return status;
Annotation
- Immediate include surface: `linux/aperture.h`, `linux/bitrev.h`, `linux/compiler.h`, `linux/delay.h`, `linux/device.h`, `linux/errno.h`, `linux/fb.h`, `linux/init.h`.
- Detected declarations: `function tgafb_pci_register`, `function tgafb_pci_unregister`, `function tgafb_tc_register`, `function tgafb_tc_unregister`, `function tgafb_check_var`, `function tgafb_set_par`, `function tgafb_set_pll`, `function tgafb_setcolreg`, `function tgafb_blank`, `function tgafb_mono_imageblit`.
- 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.