drivers/gpu/drm/drm_draw.c
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/drm_draw.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/drm_draw.c- Extension
.c- Size
- 5175 bytes
- Lines
- 187
- Domain
- Driver Families
- Bucket
- drivers/gpu
- 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/bits.hlinux/bug.hlinux/export.hlinux/iosys-map.hlinux/types.hdrm/drm_fourcc.hdrm_draw_internal.hdrm_format_internal.h
Detected Declarations
function Copyrightfunction drm_draw_color_from_xrgb8888function drm_draw_blit16function drm_draw_blit24function drm_draw_blit32function drm_draw_fill16function drm_draw_fill24function drm_draw_fill32export drm_draw_can_convert_from_xrgb8888export drm_draw_color_from_xrgb8888export drm_draw_blit16export drm_draw_blit24export drm_draw_blit32export drm_draw_fill16export drm_draw_fill24export drm_draw_fill32
Annotated Snippet
if (drm_draw_is_pixel_fg(sbuf8, spitch, x / scale, y / scale)) {
/* write blue-green-red to output in little endianness */
iosys_map_wr(dmap, off, u8, (fg32 & 0x000000FF) >> 0);
iosys_map_wr(dmap, off + 1, u8, (fg32 & 0x0000FF00) >> 8);
iosys_map_wr(dmap, off + 2, u8, (fg32 & 0x00FF0000) >> 16);
}
}
}
}
EXPORT_SYMBOL(drm_draw_blit24);
void drm_draw_blit32(struct iosys_map *dmap, unsigned int dpitch,
const u8 *sbuf8, unsigned int spitch,
unsigned int height, unsigned int width,
unsigned int scale, u32 fg32)
{
unsigned int y, x;
for (y = 0; y < height; y++)
for (x = 0; x < width; x++)
if (drm_draw_is_pixel_fg(sbuf8, spitch, x / scale, y / scale))
iosys_map_wr(dmap, y * dpitch + x * sizeof(u32), u32, fg32);
}
EXPORT_SYMBOL(drm_draw_blit32);
/*
* Fill functions
*/
void drm_draw_fill16(struct iosys_map *dmap, unsigned int dpitch,
unsigned int height, unsigned int width,
u16 color)
{
unsigned int y, x;
for (y = 0; y < height; y++)
for (x = 0; x < width; x++)
iosys_map_wr(dmap, y * dpitch + x * sizeof(u16), u16, color);
}
EXPORT_SYMBOL(drm_draw_fill16);
void drm_draw_fill24(struct iosys_map *dmap, unsigned int dpitch,
unsigned int height, unsigned int width,
u32 color)
{
unsigned int y, x;
for (y = 0; y < height; y++) {
for (x = 0; x < width; x++) {
unsigned int off = y * dpitch + x * 3;
/* write blue-green-red to output in little endianness */
iosys_map_wr(dmap, off, u8, (color & 0x000000FF) >> 0);
iosys_map_wr(dmap, off + 1, u8, (color & 0x0000FF00) >> 8);
iosys_map_wr(dmap, off + 2, u8, (color & 0x00FF0000) >> 16);
}
}
}
EXPORT_SYMBOL(drm_draw_fill24);
void drm_draw_fill32(struct iosys_map *dmap, unsigned int dpitch,
unsigned int height, unsigned int width,
u32 color)
{
unsigned int y, x;
for (y = 0; y < height; y++)
for (x = 0; x < width; x++)
iosys_map_wr(dmap, y * dpitch + x * sizeof(u32), u32, color);
}
EXPORT_SYMBOL(drm_draw_fill32);
Annotation
- Immediate include surface: `linux/bits.h`, `linux/bug.h`, `linux/export.h`, `linux/iosys-map.h`, `linux/types.h`, `drm/drm_fourcc.h`, `drm_draw_internal.h`, `drm_format_internal.h`.
- Detected declarations: `function Copyright`, `function drm_draw_color_from_xrgb8888`, `function drm_draw_blit16`, `function drm_draw_blit24`, `function drm_draw_blit32`, `function drm_draw_fill16`, `function drm_draw_fill24`, `function drm_draw_fill32`, `export drm_draw_can_convert_from_xrgb8888`, `export drm_draw_color_from_xrgb8888`.
- Atlas domain: Driver Families / drivers/gpu.
- 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.