drivers/video/fbdev/core/fbcon.c
Source file repositories/reference/linux-study-clean/drivers/video/fbdev/core/fbcon.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/video/fbdev/core/fbcon.c- Extension
.c- Size
- 83901 bytes
- Lines
- 3377
- 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.
- 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/export.hlinux/module.hlinux/types.hlinux/fs.hlinux/kernel.hlinux/delay.hlinux/console.hlinux/string.hlinux/kd.hlinux/panic.hlinux/pci.hlinux/printk.hlinux/slab.hlinux/fb.hlinux/vt_kern.hlinux/selection.hlinux/font.hlinux/smp.hlinux/init.hlinux/interrupt.hlinux/crc32.hlinux/uaccess.hlinux/vga_switcheroo.hasm/irq.hfbcon.hfbcon_rotate.hfb_internal.h
Detected Declarations
function fbcon_map_overridefunction fbcon_map_overridefunction fbcon_set_rotationfunction fbcon_rotatefunction fbcon_rotate_allfunction fbcon_set_rotationfunction fbcon_rotatefunction fbcon_rotate_allfunction fbcon_set_bitopsfunction fbcon_get_rotatefunction fbcon_skip_panicfunction fbcon_is_activefunction get_colorfunction get_fg_colorfunction get_bg_colorfunction fb_flashcursorfunction fbcon_add_cursor_workfunction fbcon_del_cursor_workfunction fbcon_fill_cursor_maskfunction fb_console_setupfunction search_fb_in_mapfunction search_for_mapped_confunction do_fbcon_takeoverfunction fbcon_prepare_logofunction fbcon_prepare_logofunction set_blitting_typefunction fbcon_invalid_charcountfunction set_blitting_typefunction fbcon_invalid_charcountfunction fbcon_releasefunction fbcon_openfunction con2fb_acquire_newinfofunction con2fb_release_oldinfofunction fb_releasefunction con2fb_init_displayfunction set_con2fb_mapfunction var_to_displayfunction display_to_varfunction fbcon_initfunction fbcon_initfunction fbcon_free_fontfunction fbcon_release_allfunction fbcon_for_each_registered_fbfunction fbcon_deinitfunction fbcon_bmovefunction fbcon_clearfunction fbcon_putcsfunction fbcon_clear_margins
Annotated Snippet
if (!fbcon_registered_fb[i]) {} else
static signed char con2fb_map[MAX_NR_CONSOLES];
static signed char con2fb_map_boot[MAX_NR_CONSOLES];
static struct fb_info *fbcon_info_from_console(int console)
{
signed char fb;
WARN_CONSOLE_UNLOCKED();
fb = con2fb_map[console];
if (fb < 0 || fb >= ARRAY_SIZE(fbcon_registered_fb))
return NULL;
return fbcon_registered_fb[fb];
}
static int logo_lines;
/* logo_shown is an index to vc_cons when >= 0; otherwise follows FBCON_LOGO
enums. */
static int logo_shown = FBCON_LOGO_CANSHOW;
/* console mappings */
static unsigned int first_fb_vc;
static unsigned int last_fb_vc = MAX_NR_CONSOLES - 1;
static bool fbcon_is_default = true;
static int primary_device = -1;
static bool fbcon_has_console_bind;
#ifdef CONFIG_FRAMEBUFFER_CONSOLE_DETECT_PRIMARY
static int map_override;
static inline void fbcon_map_override(void)
{
map_override = 1;
}
#else
static inline void fbcon_map_override(void)
{
}
#endif /* CONFIG_FRAMEBUFFER_CONSOLE_DETECT_PRIMARY */
#ifdef CONFIG_FRAMEBUFFER_CONSOLE_DEFERRED_TAKEOVER
static bool deferred_takeover = true;
#else
#define deferred_takeover false
#endif
/* font data */
static char fontname[40];
/* current fb_info */
static int info_idx = -1;
/* console rotation */
static int initial_rotation = -1;
static int margin_color;
static const struct consw fb_con;
#define advance_row(p, delta) (unsigned short *)((unsigned long)(p) + (delta) * vc->vc_size_row)
static bool fbcon_cursor_blink = true;
#define divides(a, b) ((!(a) || (b)%(a)) ? 0 : 1)
/*
* Interface used by the world
*/
static void fbcon_clear_margins(struct vc_data *vc, int bottom_only);
static void fbcon_set_palette(struct vc_data *vc, const unsigned char *table);
/*
* Internal routines
*/
static void fbcon_set_disp(struct fb_info *info, struct fb_var_screeninfo *var,
int unit);
static void fbcon_redraw_move(struct vc_data *vc, struct fbcon_display *p,
int line, int count, int dy);
static void fbcon_modechanged(struct fb_info *info);
static void fbcon_set_all_vcs(struct fb_info *info);
static struct device *fbcon_device;
#ifdef CONFIG_FRAMEBUFFER_CONSOLE_ROTATION
static inline void fbcon_set_rotation(struct fb_info *info)
{
struct fbcon_par *par = info->fbcon_par;
if (!(info->flags & FBINFO_MISC_TILEBLITTING) &&
Annotation
- Immediate include surface: `linux/export.h`, `linux/module.h`, `linux/types.h`, `linux/fs.h`, `linux/kernel.h`, `linux/delay.h`, `linux/console.h`, `linux/string.h`.
- Detected declarations: `function fbcon_map_override`, `function fbcon_map_override`, `function fbcon_set_rotation`, `function fbcon_rotate`, `function fbcon_rotate_all`, `function fbcon_set_rotation`, `function fbcon_rotate`, `function fbcon_rotate_all`, `function fbcon_set_bitops`, `function fbcon_get_rotate`.
- 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.
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.