drivers/video/fbdev/mb862xx/mb862xxfb_accel.c
Source file repositories/reference/linux-study-clean/drivers/video/fbdev/mb862xx/mb862xxfb_accel.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/video/fbdev/mb862xx/mb862xxfb_accel.c- Extension
.c- Size
- 8147 bytes
- Lines
- 327
- 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/fb.hlinux/delay.hlinux/init.hlinux/interrupt.hlinux/module.hlinux/pci.hlinux/slab.hmb862xxfb.hmb862xx_reg.hmb862xxfb_accel.h
Detected Declarations
function mb862xxfb_write_fifofunction mb86290fb_copyareafunction mb86290fb_imageblit1function mb86290fb_imageblit8function mb86290fb_imageblit16function mb86290fb_imageblitfunction mb86290fb_fillrectfunction mb862xxfb_init_accel
Annotated Snippet
if (free) {
outreg(geo, GDC_GEO_REG_INPUT_FIFO, data[total]);
total++;
free--;
} else {
free = (u32) inreg(draw, GDC_REG_FIFO_COUNT);
}
}
}
static void mb86290fb_copyarea(struct fb_info *info,
const struct fb_copyarea *area)
{
__u32 cmd[6];
cmd[0] = (GDC_TYPE_SETREGISTER << 24) | (1 << 16) | GDC_REG_MODE_BITMAP;
/* Set raster operation */
cmd[1] = (2 << 7) | (GDC_ROP_COPY << 9);
cmd[2] = GDC_TYPE_BLTCOPYP << 24;
if (area->sx >= area->dx && area->sy >= area->dy)
cmd[2] |= GDC_CMD_BLTCOPY_TOP_LEFT << 16;
else if (area->sx >= area->dx && area->sy <= area->dy)
cmd[2] |= GDC_CMD_BLTCOPY_BOTTOM_LEFT << 16;
else if (area->sx <= area->dx && area->sy >= area->dy)
cmd[2] |= GDC_CMD_BLTCOPY_TOP_RIGHT << 16;
else
cmd[2] |= GDC_CMD_BLTCOPY_BOTTOM_RIGHT << 16;
cmd[3] = (area->sy << 16) | area->sx;
cmd[4] = (area->dy << 16) | area->dx;
cmd[5] = (area->height << 16) | area->width;
mb862xxfb_write_fifo(6, cmd, info);
}
/*
* Fill in the cmd array /GDC FIFO commands/ to draw a 1bit image.
* Make sure cmd has enough room!
*/
static void mb86290fb_imageblit1(u32 *cmd, u16 step, u16 dx, u16 dy,
u16 width, u16 height, u32 fgcolor,
u32 bgcolor, const struct fb_image *image,
struct fb_info *info)
{
int i;
unsigned const char *line;
u16 bytes;
/* set colors and raster operation regs */
cmd[0] = (GDC_TYPE_SETREGISTER << 24) | (1 << 16) | GDC_REG_MODE_BITMAP;
/* Set raster operation */
cmd[1] = (2 << 7) | (GDC_ROP_COPY << 9);
cmd[2] =
(GDC_TYPE_SETCOLORREGISTER << 24) | (GDC_CMD_BODY_FORE_COLOR << 16);
cmd[3] = fgcolor;
cmd[4] =
(GDC_TYPE_SETCOLORREGISTER << 24) | (GDC_CMD_BODY_BACK_COLOR << 16);
cmd[5] = bgcolor;
i = 0;
line = image->data;
bytes = (image->width + 7) >> 3;
/* and the image */
cmd[6] = (GDC_TYPE_DRAWBITMAPP << 24) |
(GDC_CMD_BITMAP << 16) | (2 + (step * height));
cmd[7] = (dy << 16) | dx;
cmd[8] = (height << 16) | width;
while (i < height) {
memcpy(&cmd[9 + i * step], line, step << 2);
#ifdef __LITTLE_ENDIAN
{
int k = 0;
for (k = 0; k < step; k++)
cmd[9 + i * step + k] =
cpu_to_be32(cmd[9 + i * step + k]);
}
#endif
line += bytes;
i++;
}
}
/*
* Fill in the cmd array /GDC FIFO commands/ to draw a 8bit image.
* Make sure cmd has enough room!
*/
static void mb86290fb_imageblit8(u32 *cmd, u16 step, u16 dx, u16 dy,
u16 width, u16 height, u32 fgcolor,
Annotation
- Immediate include surface: `linux/fb.h`, `linux/delay.h`, `linux/init.h`, `linux/interrupt.h`, `linux/module.h`, `linux/pci.h`, `linux/slab.h`, `mb862xxfb.h`.
- Detected declarations: `function mb862xxfb_write_fifo`, `function mb86290fb_copyarea`, `function mb86290fb_imageblit1`, `function mb86290fb_imageblit8`, `function mb86290fb_imageblit16`, `function mb86290fb_imageblit`, `function mb86290fb_fillrect`, `function mb862xxfb_init_accel`.
- 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.