drivers/video/fbdev/wmt_ge_rops.c
Source file repositories/reference/linux-study-clean/drivers/video/fbdev/wmt_ge_rops.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/video/fbdev/wmt_ge_rops.c- Extension
.c- Size
- 5260 bytes
- Lines
- 192
- Domain
- Driver Families
- Bucket
- drivers/video
- Inferred role
- Driver Families: exported/initcall integration point
- Status
- integration 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.
- Exports symbols or registers init work; inspect boot/module ordering and who consumes the exported contract.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/export.hlinux/module.hlinux/fb.hlinux/io.hlinux/platform_device.hwmt_ge_rops.h
Detected Declarations
function pixel_to_patfunction wmt_ge_fillrectfunction wmt_ge_copyareafunction wmt_ge_syncfunction wmt_ge_rops_probefunction wmt_ge_rops_removeexport wmt_ge_fillrectexport wmt_ge_copyareaexport wmt_ge_sync
Annotated Snippet
// SPDX-License-Identifier: GPL-2.0-only
/*
* linux/drivers/video/wmt_ge_rops.c
*
* Accelerators for raster operations using WonderMedia Graphics Engine
*
* Copyright (C) 2010 Alexey Charkov <alchark@gmail.com>
*/
#include <linux/export.h>
#include <linux/module.h>
#include <linux/fb.h>
#include <linux/io.h>
#include <linux/platform_device.h>
#include "wmt_ge_rops.h"
#define GE_COMMAND_OFF 0x00
#define GE_DEPTH_OFF 0x04
#define GE_HIGHCOLOR_OFF 0x08
#define GE_ROPCODE_OFF 0x14
#define GE_FIRE_OFF 0x18
#define GE_SRCBASE_OFF 0x20
#define GE_SRCDISPW_OFF 0x24
#define GE_SRCDISPH_OFF 0x28
#define GE_SRCAREAX_OFF 0x2c
#define GE_SRCAREAY_OFF 0x30
#define GE_SRCAREAW_OFF 0x34
#define GE_SRCAREAH_OFF 0x38
#define GE_DESTBASE_OFF 0x3c
#define GE_DESTDISPW_OFF 0x40
#define GE_DESTDISPH_OFF 0x44
#define GE_DESTAREAX_OFF 0x48
#define GE_DESTAREAY_OFF 0x4c
#define GE_DESTAREAW_OFF 0x50
#define GE_DESTAREAH_OFF 0x54
#define GE_PAT0C_OFF 0x88 /* Pattern 0 color */
#define GE_ENABLE_OFF 0xec
#define GE_INTEN_OFF 0xf0
#define GE_STATUS_OFF 0xf8
static void __iomem *regbase;
/* from the spec it seems more like depth than bits per pixel */
static inline unsigned long pixel_to_pat(u32 depth, u32 pixel, struct fb_info *p)
{
switch (depth) {
case 1:
return ~0ul*pixel;
case 2:
return ~0ul/3*pixel;
case 4:
return ~0ul/15*pixel;
case 8:
return ~0ul/255*pixel;
case 12:
case 15:
case 16:
return ~0ul/0xffff*pixel;
case 18:
case 24:
return 0x1000001ul*pixel;
case 32:
return pixel;
default:
fb_warn_once(p, "%s: unsupported pixelformat %d\n", __func__, depth);
return 0;
}
}
void wmt_ge_fillrect(struct fb_info *p, const struct fb_fillrect *rect)
{
unsigned long fg, pat;
if (p->state != FBINFO_STATE_RUNNING)
return;
if (p->fix.visual == FB_VISUAL_TRUECOLOR ||
p->fix.visual == FB_VISUAL_DIRECTCOLOR)
fg = ((u32 *) (p->pseudo_palette))[rect->color];
else
fg = rect->color;
pat = pixel_to_pat(p->var.bits_per_pixel, fg, p);
if (p->fbops->fb_sync)
p->fbops->fb_sync(p);
writel(p->var.bits_per_pixel == 32 ? 3 :
(p->var.bits_per_pixel == 8 ? 0 : 1), regbase + GE_DEPTH_OFF);
Annotation
- Immediate include surface: `linux/export.h`, `linux/module.h`, `linux/fb.h`, `linux/io.h`, `linux/platform_device.h`, `wmt_ge_rops.h`.
- Detected declarations: `function pixel_to_pat`, `function wmt_ge_fillrect`, `function wmt_ge_copyarea`, `function wmt_ge_sync`, `function wmt_ge_rops_probe`, `function wmt_ge_rops_remove`, `export wmt_ge_fillrect`, `export wmt_ge_copyarea`, `export wmt_ge_sync`.
- Atlas domain: Driver Families / drivers/video.
- Implementation status: integration 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.