drivers/video/fbdev/s3c-fb.c
Source file repositories/reference/linux-study-clean/drivers/video/fbdev/s3c-fb.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/video/fbdev/s3c-fb.c- Extension
.c- Size
- 46477 bytes
- Lines
- 1805
- Domain
- Driver Families
- Bucket
- drivers/video
- Inferred role
- Driver Families: implementation source
- Status
- source 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.
- 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.
- Touches IRQ or DMA behavior; this matters for the representative real-device path.
- 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/kernel.hlinux/module.hlinux/platform_device.hlinux/dma-mapping.hlinux/slab.hlinux/init.hlinux/clk.hlinux/fb.hlinux/io.hlinux/uaccess.hlinux/interrupt.hlinux/pm_runtime.hlinux/platform_data/video_s3c.hvideo/samsung_fimd.h
Detected Declarations
struct s3c_fbstruct s3c_fb_variantstruct s3c_fb_win_variantstruct s3c_fb_driverdatastruct s3c_fb_palettestruct s3c_fb_winstruct s3c_fb_vsyncstruct s3c_fbfunction s3c_fb_validate_win_bppfunction s3c_fb_check_varfunction s3c_fb_calc_pixclkfunction s3c_fb_align_wordfunction vidosd_set_sizefunction vidosd_set_alphafunction shadow_protect_winfunction s3c_fb_enablefunction s3c_fb_set_parfunction s3c_fb_update_palettefunction chan_to_fieldfunction s3c_fb_setcolregfunction s3c_fb_blankfunction s3c_fb_pan_displayfunction s3c_fb_enable_irqfunction s3c_fb_disable_irqfunction s3c_fb_irqfunction s3c_fb_wait_for_vsyncfunction s3c_fb_ioctlfunction s3c_fb_missing_pixclockfunction s3c_fb_alloc_memoryfunction s3c_fb_free_memoryfunction s3c_fb_release_winfunction s3c_fb_probe_winfunction s3c_fb_set_rgb_timingfunction s3c_fb_clear_winfunction s3c_fb_probefunction s3c_fb_removefunction s3c_fb_suspendfunction s3c_fb_resumefunction s3c_fb_runtime_suspendfunction s3c_fb_runtime_resume
Annotated Snippet
struct s3c_fb_variant {
unsigned int is_2443:1;
unsigned short nr_windows;
unsigned int vidtcon;
unsigned short wincon;
unsigned short winmap;
unsigned short keycon;
unsigned short buf_start;
unsigned short buf_end;
unsigned short buf_size;
unsigned short osd;
unsigned short osd_stride;
unsigned short palette[S3C_FB_MAX_WIN];
unsigned int has_prtcon:1;
unsigned int has_shadowcon:1;
unsigned int has_blendcon:1;
unsigned int has_clksel:1;
unsigned int has_fixvclk:1;
};
/**
* struct s3c_fb_win_variant
* @has_osd_c: Set if has OSD C register.
* @has_osd_d: Set if has OSD D register.
* @has_osd_alpha: Set if can change alpha transparency for a window.
* @palette_sz: Size of palette in entries.
* @palette_16bpp: Set if palette is 16bits wide.
* @osd_size_off: If != 0, supports setting up OSD for a window; the appropriate
* register is located at the given offset from OSD_BASE.
* @valid_bpp: 1 bit per BPP setting to show valid bits-per-pixel.
*
* valid_bpp bit x is set if (x+1)BPP is supported.
*/
struct s3c_fb_win_variant {
unsigned int has_osd_c:1;
unsigned int has_osd_d:1;
unsigned int has_osd_alpha:1;
unsigned int palette_16bpp:1;
unsigned short osd_size_off;
unsigned short palette_sz;
u32 valid_bpp;
};
/**
* struct s3c_fb_driverdata - per-device type driver data for init time.
* @variant: The variant information for this driver.
* @win: The window information for each window.
*/
struct s3c_fb_driverdata {
struct s3c_fb_variant variant;
struct s3c_fb_win_variant *win[S3C_FB_MAX_WIN];
};
/**
* struct s3c_fb_palette - palette information
* @r: Red bitfield.
* @g: Green bitfield.
* @b: Blue bitfield.
* @a: Alpha bitfield.
*/
struct s3c_fb_palette {
struct fb_bitfield r;
struct fb_bitfield g;
struct fb_bitfield b;
struct fb_bitfield a;
};
/**
* struct s3c_fb_win - per window private data for each framebuffer.
* @windata: The platform data supplied for the window configuration.
* @parent: The hardware that this window is part of.
* @fbinfo: Pointer pack to the framebuffer info for this window.
* @variant: The variant information for this window.
* @palette_buffer: Buffer/cache to hold palette entries.
* @pseudo_palette: For use in TRUECOLOUR modes for entries 0..15/
* @index: The window number of this window.
* @palette: The bitfields for changing r/g/b into a hardware palette entry.
*/
struct s3c_fb_win {
struct s3c_fb_pd_win *windata;
struct s3c_fb *parent;
struct fb_info *fbinfo;
struct s3c_fb_palette palette;
struct s3c_fb_win_variant variant;
u32 *palette_buffer;
u32 pseudo_palette[16];
unsigned int index;
};
Annotation
- Immediate include surface: `linux/kernel.h`, `linux/module.h`, `linux/platform_device.h`, `linux/dma-mapping.h`, `linux/slab.h`, `linux/init.h`, `linux/clk.h`, `linux/fb.h`.
- Detected declarations: `struct s3c_fb`, `struct s3c_fb_variant`, `struct s3c_fb_win_variant`, `struct s3c_fb_driverdata`, `struct s3c_fb_palette`, `struct s3c_fb_win`, `struct s3c_fb_vsync`, `struct s3c_fb`, `function s3c_fb_validate_win_bpp`, `function s3c_fb_check_var`.
- Atlas domain: Driver Families / drivers/video.
- Implementation status: source 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.
- IRQ or DMA behavior appears here, which is relevant to the selected PCIe/NVMe device path.
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.