drivers/video/fbdev/core/fb_imageblit.h
Source file repositories/reference/linux-study-clean/drivers/video/fbdev/core/fb_imageblit.h
File Facts
- System
- Linux kernel
- Corpus path
drivers/video/fbdev/core/fb_imageblit.h- Extension
.h- Size
- 14349 bytes
- Lines
- 496
- 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
fb_draw.h
Detected Declarations
struct fb_bitmap_iterstruct fb_color_iterstruct fb_bitmap4x_iterfunction fb_bitmap_imagefunction fb_color_imagefunction fb_bitmap4x_imagefunction fb_bitblitfunction fb_color_imageblitfunction fb_bitmap4x_imageblitfunction fb_bitmap1x_imageblitfunction fb_bitmap_1ppwfunction fb_packfunction fb_bitmap_2ppwfunction fb_bitmap_4ppwfunction fb_bitmap_imageblitfunction fb_imageblit
Annotated Snippet
struct fb_bitmap_iter {
const u8 *data;
unsigned long colors[2];
int width, i;
};
static bool fb_bitmap_image(void *iterator, unsigned long *pixels, int *bits)
{
struct fb_bitmap_iter *iter = iterator;
if (iter->i < iter->width) {
int bit = ~iter->i & (BITS_PER_BYTE-1);
int byte = iter->i++ / BITS_PER_BYTE;
*pixels = iter->colors[(iter->data[byte] >> bit) & 1];
return true;
}
iter->data += BITS_TO_BYTES(iter->width);
iter->i = 0;
return false;
}
/* color image iterator, one pixel at a time */
struct fb_color_iter {
const u8 *data;
const u32 *palette;
struct fb_reverse reverse;
int shift;
int width, i;
};
static bool fb_color_image(void *iterator, unsigned long *pixels, int *bits)
{
struct fb_color_iter *iter = iterator;
if (iter->i < iter->width) {
unsigned long color = iter->data[iter->i++];
if (iter->palette)
color = iter->palette[color];
*pixels = color << iter->shift;
if (iter->reverse.pixel)
*pixels = fb_reverse_bits_long(*pixels);
return true;
}
iter->data += iter->width;
iter->i = 0;
return false;
}
/* bitmap image iterator, 4 pixels at a time */
struct fb_bitmap4x_iter {
const u8 *data;
u32 fgxcolor, bgcolor;
int width, i;
const u32 *expand;
int bpp;
bool top;
};
static bool fb_bitmap4x_image(void *iterator, unsigned long *pixels, int *bits)
{
struct fb_bitmap4x_iter *iter = iterator;
u8 data;
if (iter->i >= BITS_PER_BYTE/2) {
iter->i -= BITS_PER_BYTE/2;
iter->top = !iter->top;
if (iter->top)
data = *iter->data++ >> BITS_PER_BYTE/2;
else
data = iter->data[-1] & ((1 << BITS_PER_BYTE/2)-1);
} else if (iter->i != 0) {
*bits = iter->bpp * iter->i;
if (iter->top)
data = iter->data[-1] & ((1 << BITS_PER_BYTE/2)-1);
else
data = *iter->data++ >> BITS_PER_BYTE/2;
#ifndef __LITTLE_ENDIAN
data >>= BITS_PER_BYTE/2 - iter->i;
#endif
iter->i = 0;
} else {
*bits = iter->bpp * BITS_PER_BYTE/2;
iter->i = iter->width;
iter->top = false;
return false;
}
*pixels = (iter->fgxcolor & iter->expand[data]) ^ iter->bgcolor;
#ifndef __LITTLE_ENDIAN
Annotation
- Immediate include surface: `fb_draw.h`.
- Detected declarations: `struct fb_bitmap_iter`, `struct fb_color_iter`, `struct fb_bitmap4x_iter`, `function fb_bitmap_image`, `function fb_color_image`, `function fb_bitmap4x_image`, `function fb_bitblit`, `function fb_color_imageblit`, `function fb_bitmap4x_imageblit`, `function fb_bitmap1x_imageblit`.
- 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.