drivers/video/sticore.c
Source file repositories/reference/linux-study-clean/drivers/video/sticore.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/video/sticore.c- Extension
.c- Size
- 30880 bytes
- Lines
- 1208
- 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/module.hlinux/types.hlinux/kernel.hlinux/slab.hlinux/init.hlinux/pci.hlinux/font.hasm/hardware.hasm/page.hasm/parisc-device.hasm/pdc.hasm/cacheflush.hasm/grfioctl.hvideo/sticore.h
Detected Declarations
function sti_init_graphfunction sti_inq_conffunction sti_putcfunction sti_setfunction sti_clearfunction sti_bmovefunction sti_flushfunction sti_rom_copyfunction sti_setupfunction sti_font_setupfunction sti_dump_globcfgfunction sti_dump_outptrfunction sti_init_glob_cfgfunction sti_select_fbfontfunction sti_select_fbfontfunction sti_dump_fontfunction sti_search_fontfunction sti_dump_romfunction sti_cook_fontsfunction sti_font_convert_bytemodefunction sti_bmode_rom_copyfunction sti_read_romfunction pdc_add_validfunction sticore_check_for_default_stifunction sticore_pa_initfunction sticore_pci_initfunction sticore_pci_removefunction sti_init_romsfunction sti_get_romfunction sti_callexport sti_font_convert_bytemodeexport sti_get_rom
Annotated Snippet
static struct pci_driver pci_sti_driver = {
.name = "sti",
.id_table = sti_pci_tbl,
.probe = sticore_pci_init,
.remove = __exit_p(sticore_pci_remove),
};
static struct parisc_device_id sti_pa_tbl[] = {
{ HPHW_FIO, HVERSION_REV_ANY_ID, HVERSION_ANY_ID, 0x00077 },
{ HPHW_FIO, HVERSION_REV_ANY_ID, HVERSION_ANY_ID, 0x00085 },
{ 0, }
};
MODULE_DEVICE_TABLE(parisc, sti_pa_tbl);
static struct parisc_driver pa_sti_driver __refdata = {
.name = "sti",
.id_table = sti_pa_tbl,
.probe = sticore_pa_init,
};
/*
* sti_init_roms() - detects all STI ROMs and stores them in sti_roms[]
*/
static int sticore_initialized __read_mostly;
static void sti_init_roms(void)
{
if (sticore_initialized)
return;
sticore_initialized = 1;
pr_info("STI GSC/PCI core graphics driver "
STI_DRIVERVERSION "\n");
/* Register drivers for native & PCI cards */
register_parisc_driver(&pa_sti_driver);
WARN_ON(pci_register_driver(&pci_sti_driver));
/* if we didn't find the given default sti, take the first one */
if (!default_sti)
default_sti = sti_roms[0];
}
/*
* index = 0 gives default sti
* index > 0 gives other stis in detection order
*/
struct sti_struct * sti_get_rom(unsigned int index)
{
if (!sticore_initialized)
sti_init_roms();
if (index == 0)
return default_sti;
if (index > num_sti_roms)
return NULL;
return sti_roms[index-1];
}
EXPORT_SYMBOL(sti_get_rom);
int sti_call(const struct sti_struct *sti, unsigned long func,
const void *flags, void *inptr, void *outptr,
struct sti_glob_cfg *glob_cfg)
{
unsigned long _flags = STI_PTR(flags);
unsigned long _inptr = STI_PTR(inptr);
unsigned long _outptr = STI_PTR(outptr);
unsigned long _glob_cfg = STI_PTR(glob_cfg);
int ret;
/* Check for overflow when using 32bit STI on 64bit kernel. */
if (WARN_ONCE(IS_ENABLED(CONFIG_64BIT) && !sti->do_call64 &&
(upper_32_bits(_flags) || upper_32_bits(_inptr) ||
upper_32_bits(_outptr) || upper_32_bits(_glob_cfg)),
"Out of 32bit-range pointers!"))
return -1;
ret = pdc_sti_call(func, _flags, _inptr, _outptr, _glob_cfg,
sti->do_call64);
return ret;
}
Annotation
- Immediate include surface: `linux/module.h`, `linux/types.h`, `linux/kernel.h`, `linux/slab.h`, `linux/init.h`, `linux/pci.h`, `linux/font.h`, `asm/hardware.h`.
- Detected declarations: `function sti_init_graph`, `function sti_inq_conf`, `function sti_putc`, `function sti_set`, `function sti_clear`, `function sti_bmove`, `function sti_flush`, `function sti_rom_copy`, `function sti_setup`, `function sti_font_setup`.
- 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.