drivers/video/fbdev/savage/savagefb_accel.c
Source file repositories/reference/linux-study-clean/drivers/video/fbdev/savage/savagefb_accel.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/video/fbdev/savage/savagefb_accel.c- Extension
.c- Size
- 3244 bytes
- Lines
- 138
- 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/kernel.hlinux/string.hlinux/fb.hlinux/module.hsavagefb.h
Detected Declarations
function savagefb_syncfunction savagefb_copyareafunction savagefb_fillrectfunction savagefb_imageblit
Annotated Snippet
#include <linux/kernel.h>
#include <linux/string.h>
#include <linux/fb.h>
#include <linux/module.h>
#include "savagefb.h"
static u32 savagefb_rop[] = {
0xCC, /* ROP_COPY */
0x5A /* ROP_XOR */
};
int savagefb_sync(struct fb_info *info)
{
struct savagefb_par *par = info->par;
par->SavageWaitIdle(par);
return 0;
}
void savagefb_copyarea(struct fb_info *info, const struct fb_copyarea *region)
{
struct savagefb_par *par = info->par;
int sx = region->sx, dx = region->dx;
int sy = region->sy, dy = region->dy;
int cmd;
if (!region->width || !region->height)
return;
par->bci_ptr = 0;
cmd = BCI_CMD_RECT | BCI_CMD_DEST_GBD | BCI_CMD_SRC_GBD;
BCI_CMD_SET_ROP(cmd, savagefb_rop[0]);
if (dx <= sx) {
cmd |= BCI_CMD_RECT_XP;
} else {
sx += region->width - 1;
dx += region->width - 1;
}
if (dy <= sy) {
cmd |= BCI_CMD_RECT_YP;
} else {
sy += region->height - 1;
dy += region->height - 1;
}
par->SavageWaitFifo(par,4);
BCI_SEND(cmd);
BCI_SEND(BCI_X_Y(sx, sy));
BCI_SEND(BCI_X_Y(dx, dy));
BCI_SEND(BCI_W_H(region->width, region->height));
}
void savagefb_fillrect(struct fb_info *info, const struct fb_fillrect *rect)
{
struct savagefb_par *par = info->par;
int cmd, color;
if (!rect->width || !rect->height)
return;
if (info->fix.visual == FB_VISUAL_PSEUDOCOLOR)
color = rect->color;
else
color = ((u32 *)info->pseudo_palette)[rect->color];
cmd = BCI_CMD_RECT | BCI_CMD_RECT_XP | BCI_CMD_RECT_YP |
BCI_CMD_DEST_GBD | BCI_CMD_SRC_SOLID |
BCI_CMD_SEND_COLOR;
par->bci_ptr = 0;
BCI_CMD_SET_ROP(cmd, savagefb_rop[rect->rop]);
par->SavageWaitFifo(par,4);
BCI_SEND(cmd);
BCI_SEND(color);
BCI_SEND( BCI_X_Y(rect->dx, rect->dy) );
BCI_SEND( BCI_W_H(rect->width, rect->height) );
}
void savagefb_imageblit(struct fb_info *info, const struct fb_image *image)
{
struct savagefb_par *par = info->par;
int fg, bg, size, i, width;
int cmd;
u32 *src = (u32 *) image->data;
if (!image->width || !image->height)
return;
Annotation
- Immediate include surface: `linux/kernel.h`, `linux/string.h`, `linux/fb.h`, `linux/module.h`, `savagefb.h`.
- Detected declarations: `function savagefb_sync`, `function savagefb_copyarea`, `function savagefb_fillrect`, `function savagefb_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.