drivers/video/fbdev/atafb_mfb.c
Source file repositories/reference/linux-study-clean/drivers/video/fbdev/atafb_mfb.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/video/fbdev/atafb_mfb.c- Extension
.c- Size
- 2242 bytes
- Lines
- 90
- 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.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/string.hlinux/fb.hatafb.hatafb_utils.h
Detected Declarations
function atafb_mfb_copyareafunction atafb_mfb_fillrectfunction atafb_mfb_linefill
Annotated Snippet
#include <linux/string.h>
#include <linux/fb.h>
#include "atafb.h"
#include "atafb_utils.h"
/*
* Monochrome
*/
void atafb_mfb_copyarea(struct fb_info *info, u_long next_line,
int sy, int sx, int dy, int dx,
int height, int width)
{
u8 *src, *dest;
u_int rows;
if (sx == 0 && dx == 0 && width == next_line) {
src = (u8 *)info->screen_base + sy * (width >> 3);
dest = (u8 *)info->screen_base + dy * (width >> 3);
fb_memmove(dest, src, height * (width >> 3));
} else if (dy <= sy) {
src = (u8 *)info->screen_base + sy * next_line + (sx >> 3);
dest = (u8 *)info->screen_base + dy * next_line + (dx >> 3);
for (rows = height; rows--;) {
fb_memmove(dest, src, width >> 3);
src += next_line;
dest += next_line;
}
} else {
src = (u8 *)info->screen_base + (sy + height - 1) * next_line + (sx >> 3);
dest = (u8 *)info->screen_base + (dy + height - 1) * next_line + (dx >> 3);
for (rows = height; rows--;) {
fb_memmove(dest, src, width >> 3);
src -= next_line;
dest -= next_line;
}
}
}
void atafb_mfb_fillrect(struct fb_info *info, u_long next_line, u32 color,
int sy, int sx, int height, int width)
{
u8 *dest;
u_int rows;
dest = (u8 *)info->screen_base + sy * next_line + (sx >> 3);
if (sx == 0 && width == next_line) {
if (color)
fb_memset255(dest, height * (width >> 3));
else
fb_memclear(dest, height * (width >> 3));
} else {
for (rows = height; rows--; dest += next_line) {
if (color)
fb_memset255(dest, width >> 3);
else
fb_memclear_small(dest, width >> 3);
}
}
}
void atafb_mfb_linefill(struct fb_info *info, u_long next_line,
int dy, int dx, u32 width,
const u8 *data, u32 bgcolor, u32 fgcolor)
{
u8 *dest;
u_int rows;
dest = (u8 *)info->screen_base + dy * next_line + (dx >> 3);
for (rows = width / 8; rows--; /* check margins */ ) {
// use fast_memmove or fb_memmove
*dest++ = *data++;
}
}
Annotation
- Immediate include surface: `linux/string.h`, `linux/fb.h`, `atafb.h`, `atafb_utils.h`.
- Detected declarations: `function atafb_mfb_copyarea`, `function atafb_mfb_fillrect`, `function atafb_mfb_linefill`.
- 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.