drivers/media/pci/ivtv/ivtvfb.c
Source file repositories/reference/linux-study-clean/drivers/media/pci/ivtv/ivtvfb.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/media/pci/ivtv/ivtvfb.c- Extension
.c- Size
- 36998 bytes
- Lines
- 1304
- Domain
- Driver Families
- Bucket
- drivers/media
- 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
ivtv-driver.hivtv-cards.hivtv-i2c.hivtv-udma.hivtv-mailbox.hivtv-firmware.hlinux/fb.hlinux/ivtvfb.hasm/memtype.h
Detected Declarations
struct osd_infostruct ivtv_osd_coordsfunction ivtvfb_get_framebufferfunction ivtvfb_get_osd_coordsfunction ivtvfb_set_osd_coordsfunction ivtvfb_set_display_windowfunction ivtvfb_prep_dec_dma_to_devicefunction test_bitfunction ivtvfb_prep_framefunction ivtvfb_writefunction ivtvfb_ioctlfunction ivtvfb_set_varfunction ivtvfb_get_fixfunction _ivtvfb_check_varfunction ivtvfb_check_varfunction ivtvfb_pan_displayfunction ivtvfb_set_parfunction ivtvfb_setcolregfunction ivtvfb_blankfunction ivtvfb_restorefunction ivtvfb_init_vidmodefunction ivtvfb_init_iofunction ivtvfb_release_buffersfunction ivtvfb_init_cardfunction ivtvfb_callback_initfunction ivtvfb_callback_cleanupfunction ivtvfb_initfunction ivtvfb_cleanupmodule init ivtvfb_init
Annotated Snippet
struct device_driver *drv;
int registered = 0;
int err;
if (ivtvfb_card_id < -1 || ivtvfb_card_id >= IVTV_MAX_CARDS) {
pr_err("ivtvfb_card_id parameter is out of range (valid range: -1 - %d)\n",
IVTV_MAX_CARDS - 1);
return -EINVAL;
}
drv = driver_find("ivtv", &pci_bus_type);
err = driver_for_each_device(drv, NULL, ®istered, ivtvfb_callback_init);
(void)err; /* suppress compiler warning */
if (!registered) {
pr_err("no cards found\n");
return -ENODEV;
}
return 0;
}
static void ivtvfb_cleanup(void)
{
struct device_driver *drv;
int err;
pr_info("Unloading framebuffer module\n");
drv = driver_find("ivtv", &pci_bus_type);
err = driver_for_each_device(drv, NULL, NULL, ivtvfb_callback_cleanup);
(void)err; /* suppress compiler warning */
}
module_init(ivtvfb_init);
module_exit(ivtvfb_cleanup);
Annotation
- Immediate include surface: `ivtv-driver.h`, `ivtv-cards.h`, `ivtv-i2c.h`, `ivtv-udma.h`, `ivtv-mailbox.h`, `ivtv-firmware.h`, `linux/fb.h`, `linux/ivtvfb.h`.
- Detected declarations: `struct osd_info`, `struct ivtv_osd_coords`, `function ivtvfb_get_framebuffer`, `function ivtvfb_get_osd_coords`, `function ivtvfb_set_osd_coords`, `function ivtvfb_set_display_window`, `function ivtvfb_prep_dec_dma_to_device`, `function test_bit`, `function ivtvfb_prep_frame`, `function ivtvfb_write`.
- Atlas domain: Driver Families / drivers/media.
- 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.