drivers/video/fbdev/core/softcursor.c
Source file repositories/reference/linux-study-clean/drivers/video/fbdev/core/softcursor.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/video/fbdev/core/softcursor.c- Extension
.c- Size
- 1941 bytes
- Lines
- 77
- 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/module.hlinux/string.hlinux/fb.hlinux/slab.hasm/io.hfbcon.h
Detected Declarations
function soft_cursor
Annotated Snippet
if (!par->cursor_src) {
par->cursor_size = 0;
return -ENOMEM;
}
}
src = par->cursor_src + sizeof(struct fb_image);
image = (struct fb_image *)par->cursor_src;
*image = cursor->image;
d_pitch = (s_pitch + scan_align) & ~scan_align;
size = d_pitch * image->height + buf_align;
size &= ~buf_align;
dst = fb_get_buffer_offset(info, &info->pixmap, size);
if (cursor->enable) {
switch (cursor->rop) {
case ROP_XOR:
for (i = 0; i < dsize; i++)
src[i] = image->data[i] ^ cursor->mask[i];
break;
case ROP_COPY:
default:
for (i = 0; i < dsize; i++)
src[i] = image->data[i] & cursor->mask[i];
break;
}
} else
memcpy(src, image->data, dsize);
fb_pad_aligned_buffer(dst, d_pitch, src, s_pitch, image->height);
image->data = dst;
info->fbops->fb_imageblit(info, image);
return 0;
}
Annotation
- Immediate include surface: `linux/module.h`, `linux/string.h`, `linux/fb.h`, `linux/slab.h`, `asm/io.h`, `fbcon.h`.
- Detected declarations: `function soft_cursor`.
- 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.