drivers/video/fbdev/core/fbcon_ud.c
Source file repositories/reference/linux-study-clean/drivers/video/fbdev/core/fbcon_ud.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/video/fbdev/core/fbcon_ud.c- Extension
.c- Size
- 11009 bytes
- Lines
- 411
- 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.
- 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/slab.hlinux/string.hlinux/fb.hlinux/vt_kern.hlinux/console.hasm/types.hfbcon.hfbcon_rotate.h
Detected Declarations
function Copyrightfunction ud_bmovefunction ud_clearfunction ud_putcs_alignedfunction ud_putcs_unalignedfunction ud_putcsfunction ud_clear_marginsfunction ud_cursorfunction ud_update_startfunction fbcon_set_bitops_ud
Annotated Snippet
if (attr) {
ud_update_attr(buf, src, attr, vc);
src = buf;
}
if (likely(idx == 1))
__fb_pad_aligned_buffer(dst, d_pitch, src, idx,
image->height);
else
fb_pad_aligned_buffer(dst, d_pitch, src, idx,
image->height);
dst += s_pitch;
}
info->fbops->fb_imageblit(info, image);
}
static inline void ud_putcs_unaligned(struct vc_data *vc,
struct fb_info *info, const u16 *s,
u32 attr, u32 cnt, u32 d_pitch,
u32 s_pitch, u32 cellsize,
struct fb_image *image, u8 *buf,
u8 *dst)
{
struct fbcon_par *par = info->fbcon_par;
u16 charmask = vc->vc_hi_font_mask ? 0x1ff : 0xff;
u32 shift_low = 0, mod = vc->vc_font.width % 8;
u32 shift_high = 8;
u32 idx = vc->vc_font.width >> 3;
u8 *src;
while (cnt--) {
src = par->rotated.buf + (scr_readw(s--) & charmask) * cellsize;
if (attr) {
ud_update_attr(buf, src, attr, vc);
src = buf;
}
fb_pad_unaligned_buffer(dst, d_pitch, src, idx,
image->height, shift_high,
shift_low, mod);
shift_low += mod;
dst += (shift_low >= 8) ? s_pitch : s_pitch - 1;
shift_low &= 7;
shift_high = 8 - shift_low;
}
info->fbops->fb_imageblit(info, image);
}
static void ud_putcs(struct vc_data *vc, struct fb_info *info,
const unsigned short *s, int count, int yy, int xx,
int fg, int bg)
{
struct fb_image image;
struct fbcon_par *par = info->fbcon_par;
u32 width = font_glyph_pitch(vc->vc_font.width);
u32 cellsize = width * vc->vc_font.height;
u32 maxcnt = info->pixmap.size/cellsize;
u32 scan_align = info->pixmap.scan_align - 1;
u32 buf_align = info->pixmap.buf_align - 1;
u32 mod = vc->vc_font.width % 8, cnt, pitch, size;
u32 attribute = get_attribute(info, scr_readw(s));
u8 *dst, *buf = NULL;
u32 vyres = GETVYRES(par->p, info);
u32 vxres = GETVXRES(par->p, info);
if (!par->rotated.buf)
return;
image.fg_color = fg;
image.bg_color = bg;
image.dy = vyres - ((yy * vc->vc_font.height) + vc->vc_font.height);
image.dx = vxres - ((xx + count) * vc->vc_font.width);
image.height = vc->vc_font.height;
image.depth = 1;
if (attribute) {
buf = kmalloc(cellsize, GFP_KERNEL);
if (!buf)
return;
}
s += count - 1;
while (count) {
if (count > maxcnt)
Annotation
- Immediate include surface: `linux/module.h`, `linux/slab.h`, `linux/string.h`, `linux/fb.h`, `linux/vt_kern.h`, `linux/console.h`, `asm/types.h`, `fbcon.h`.
- Detected declarations: `function Copyright`, `function ud_bmove`, `function ud_clear`, `function ud_putcs_aligned`, `function ud_putcs_unaligned`, `function ud_putcs`, `function ud_clear_margins`, `function ud_cursor`, `function ud_update_start`, `function fbcon_set_bitops_ud`.
- Atlas domain: Driver Families / drivers/video.
- Implementation status: source implementation candidate.
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.