drivers/video/fbdev/amifb.c
Source file repositories/reference/linux-study-clean/drivers/video/fbdev/amifb.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/video/fbdev/amifb.c- Extension
.c- Size
- 101753 bytes
- Lines
- 3788
- 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.
- Touches IRQ or DMA behavior; this matters for the representative real-device path.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/module.hlinux/kernel.hlinux/errno.hlinux/string.hlinux/mm.hlinux/delay.hlinux/interrupt.hlinux/fb.hlinux/init.hlinux/ioport.hlinux/platform_device.hlinux/uaccess.hasm/irq.hasm/amigahw.hasm/amigaints.hasm/setup.hc2p.h
Detected Declarations
struct fb_fix_cursorinfostruct fb_var_cursorinfostruct fb_cursorstatestruct amifb_parfunction ami_decode_varfunction AMIGAHW_PRESENTfunction AMIGAHW_PRESENTfunction ami_encode_varfunction ami_update_parfunction ami_pan_varfunction ami_update_displayfunction modefunction ami_do_blankfunction ami_get_fix_cursorinfofunction ami_get_var_cursorinfofunction ami_set_var_cursorinfofunction ami_get_cursorstatefunction ami_set_cursorstatefunction ami_set_spritefunction ami_init_copperfunction ami_reinit_copperfunction ami_rebuild_copperfunction ami_build_copperfunction amifb_setup_mcapfunction amifb_setupfunction amifb_check_varfunction amifb_set_parfunction amifb_setcolregfunction ami_do_blankfunction amifb_blankfunction amifb_pan_displayfunction tofunction xorfunction bitcpyfunction bitcpy_revfunction bitcpy_notfunction bitfill32function bitxor32function fill_one_linefunction xor_one_linefunction amifb_fillrectfunction copy_one_linefunction copy_one_line_revfunction amifb_copyareafunction expand_one_linefunction amifb_imageblitfunction amifb_ioctlfunction cursor
Annotated Snippet
struct fb_fix_cursorinfo {
__u16 crsr_width; /* width and height of the cursor in */
__u16 crsr_height; /* pixels (zero if no cursor) */
__u16 crsr_xsize; /* cursor size in display pixels */
__u16 crsr_ysize;
__u16 crsr_color1; /* colormap entry for cursor color1 */
__u16 crsr_color2; /* colormap entry for cursor color2 */
};
struct fb_var_cursorinfo {
__u16 width;
__u16 height;
__u16 xspot;
__u16 yspot;
DECLARE_FLEX_ARRAY(__u8, data); /* field with [height][width] */
};
struct fb_cursorstate {
__s16 xoffset;
__s16 yoffset;
__u16 mode;
};
#define FB_CURSOR_OFF 0
#define FB_CURSOR_ON 1
#define FB_CURSOR_FLASH 2
/*
* Hardware Cursor
*/
static int cursorrate = 20; /* Number of frames/flash toggle */
static u_short cursorstate = -1;
static u_short cursormode = FB_CURSOR_OFF;
static u_short *lofsprite, *shfsprite, *dummysprite;
/*
* Current Video Mode
*/
struct amifb_par {
/* General Values */
int xres; /* vmode */
int yres; /* vmode */
int vxres; /* vmode */
int vyres; /* vmode */
int xoffset; /* vmode */
int yoffset; /* vmode */
u_short bpp; /* vmode */
u_short clk_shift; /* vmode */
u_short line_shift; /* vmode */
int vmode; /* vmode */
u_short diwstrt_h; /* vmode */
u_short diwstop_h; /* vmode */
u_short diwstrt_v; /* vmode */
u_short diwstop_v; /* vmode */
u_long next_line; /* modulo for next line */
u_long next_plane; /* modulo for next plane */
/* Cursor Values */
struct {
short crsr_x; /* movecursor */
short crsr_y; /* movecursor */
short spot_x;
short spot_y;
u_short height;
u_short width;
u_short fmode;
} crsr;
/* OCS Hardware Registers */
u_long bplpt0; /* vmode, pan (Note: physical address) */
u_long bplpt0wrap; /* vmode, pan (Note: physical address) */
u_short ddfstrt;
u_short ddfstop;
u_short bpl1mod;
u_short bpl2mod;
u_short bplcon0; /* vmode */
u_short bplcon1; /* vmode */
u_short htotal; /* vmode */
u_short vtotal; /* vmode */
/* Additional ECS Hardware Registers */
Annotation
- Immediate include surface: `linux/module.h`, `linux/kernel.h`, `linux/errno.h`, `linux/string.h`, `linux/mm.h`, `linux/delay.h`, `linux/interrupt.h`, `linux/fb.h`.
- Detected declarations: `struct fb_fix_cursorinfo`, `struct fb_var_cursorinfo`, `struct fb_cursorstate`, `struct amifb_par`, `function ami_decode_var`, `function AMIGAHW_PRESENT`, `function AMIGAHW_PRESENT`, `function ami_encode_var`, `function ami_update_par`, `function ami_pan_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.
- 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.