drivers/staging/sm750fb/sm750_cursor.c
Source file repositories/reference/linux-study-clean/drivers/staging/sm750fb/sm750_cursor.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/staging/sm750fb/sm750_cursor.c- Extension
.c- Size
- 4074 bytes
- Lines
- 176
- Domain
- Driver Families
- Bucket
- drivers/staging
- 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/module.hlinux/kernel.hlinux/errno.hlinux/string.hlinux/mm.hlinux/slab.hlinux/delay.hlinux/fb.hlinux/ioport.hlinux/init.hlinux/pci.hlinux/vmalloc.hlinux/pagemap.hlinux/console.hlinux/platform_device.hsm750.hsm750_cursor.h
Detected Declarations
function sm750_hw_cursor_enablefunction sm750_hw_cursor_disablefunction sm750_hw_cursor_set_sizefunction sm750_hw_cursor_set_posfunction sm750_hw_cursor_set_colorfunction sm750_hw_cursor_set_datafunction sm750_hw_cursor_set_data2
Annotated Snippet
if (mask & (0x80 >> j)) {
if (rop == ROP_XOR)
opr = mask ^ color;
else
opr = mask & color;
/* 2 stands for forecolor and 1 for backcolor */
data |= ((opr & (0x80 >> j)) ? 2 : 1) << (j * 2);
}
}
iowrite16(data, pbuffer);
/* assume pitch is 1,2,4,8,...*/
if ((i + 1) % pitch == 0) {
/* need a return */
pstart += offset;
pbuffer = pstart;
} else {
pbuffer += sizeof(u16);
}
}
}
void sm750_hw_cursor_set_data2(struct lynx_cursor *cursor, u16 rop,
const u8 *pcol, const u8 *pmsk)
{
int i, j, count, pitch, offset;
u8 color, mask;
u16 data;
void __iomem *pbuffer, *pstart;
/* in byte*/
pitch = cursor->w >> 3;
/* in byte */
count = pitch * cursor->h;
/* in byte */
offset = cursor->max_w * 2 / 8;
data = 0;
pstart = cursor->vstart;
pbuffer = pstart;
for (i = 0; i < count; i++) {
color = *pcol++;
mask = *pmsk++;
data = 0;
for (j = 0; j < 8; j++) {
if (mask & (1 << j))
data |= ((color & (1 << j)) ? 1 : 2) << (j * 2);
}
iowrite16(data, pbuffer);
/* assume pitch is 1,2,4,8,...*/
if (!(i & (pitch - 1))) {
/* need a return */
pstart += offset;
pbuffer = pstart;
} else {
pbuffer += sizeof(u16);
}
}
}
Annotation
- Immediate include surface: `linux/module.h`, `linux/kernel.h`, `linux/errno.h`, `linux/string.h`, `linux/mm.h`, `linux/slab.h`, `linux/delay.h`, `linux/fb.h`.
- Detected declarations: `function sm750_hw_cursor_enable`, `function sm750_hw_cursor_disable`, `function sm750_hw_cursor_set_size`, `function sm750_hw_cursor_set_pos`, `function sm750_hw_cursor_set_color`, `function sm750_hw_cursor_set_data`, `function sm750_hw_cursor_set_data2`.
- Atlas domain: Driver Families / drivers/staging.
- 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.