Rev 4647 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 4647 | Rev 4651 | ||
---|---|---|---|
Line 248... | Line 248... | ||
248 | { |
248 | { |
249 | *((uint32_t *) dst) |
249 | *((uint32_t *) dst) |
250 | = (BLUE(rgb, 8) << 16) | (GREEN(rgb, 8) << 8) | RED(rgb, 8); |
250 | = (BLUE(rgb, 8) << 16) | (GREEN(rgb, 8) << 8) | RED(rgb, 8); |
251 | } |
251 | } |
252 | 252 | ||
- | 253 | static void rgb_8880(void *dst, uint32_t rgb) |
|
- | 254 | { |
|
- | 255 | *((uint32_t *) dst) |
|
- | 256 | = (RED(rgb, 8) << 24) | (GREEN(rgb, 8) << 16) | BLUE(rgb, 8) << 8; |
|
- | 257 | } |
|
- | 258 | ||
- | 259 | static void mask_8880(void *dst, bool mask) |
|
- | 260 | { |
|
- | 261 | *((uint32_t *) dst) = (mask ? 0xffffff00 : 0); |
|
- | 262 | } |
|
253 | 263 | ||
254 | /** RGB 8:8:8 conversion |
264 | /** RGB 8:8:8 conversion |
255 | * |
265 | * |
256 | */ |
266 | */ |
257 | static void rgb_888(void *dst, uint32_t rgb) |
267 | static void rgb_888(void *dst, uint32_t rgb) |
Line 648... | Line 658... | ||
648 | screen.rgb_conv = bgr_888; |
658 | screen.rgb_conv = bgr_888; |
649 | screen.mask_conv = mask_888; |
659 | screen.mask_conv = mask_888; |
650 | screen.pixelbytes = 3; |
660 | screen.pixelbytes = 3; |
651 | break; |
661 | break; |
652 | case VISUAL_RGB_8_8_8_0: |
662 | case VISUAL_RGB_8_8_8_0: |
653 | screen.rgb_conv = rgb_888; |
663 | screen.rgb_conv = rgb_8880; |
654 | screen.mask_conv = mask_888; |
664 | screen.mask_conv = mask_8880; |
655 | screen.pixelbytes = 4; |
665 | screen.pixelbytes = 4; |
656 | break; |
666 | break; |
657 | case VISUAL_RGB_0_8_8_8: |
667 | case VISUAL_RGB_0_8_8_8: |
658 | screen.rgb_conv = rgb_0888; |
668 | screen.rgb_conv = rgb_0888; |
659 | screen.mask_conv = mask_0888; |
669 | screen.mask_conv = mask_0888; |
Line 1742... | Line 1752... | ||
1742 | unsigned int fb_offset = sysinfo_value("fb.offset"); |
1752 | unsigned int fb_offset = sysinfo_value("fb.offset"); |
1743 | unsigned int fb_width = sysinfo_value("fb.width"); |
1753 | unsigned int fb_width = sysinfo_value("fb.width"); |
1744 | unsigned int fb_height = sysinfo_value("fb.height"); |
1754 | unsigned int fb_height = sysinfo_value("fb.height"); |
1745 | unsigned int fb_scanline = sysinfo_value("fb.scanline"); |
1755 | unsigned int fb_scanline = sysinfo_value("fb.scanline"); |
1746 | unsigned int fb_visual = sysinfo_value("fb.visual"); |
1756 | unsigned int fb_visual = sysinfo_value("fb.visual"); |
1747 | 1757 | ||
1748 | unsigned int fbsize = fb_scanline * fb_height; |
1758 | unsigned int fbsize = fb_scanline * fb_height; |
1749 | void *fb_addr = as_get_mappable_page(fbsize); |
1759 | void *fb_addr = as_get_mappable_page(fbsize); |
1750 | 1760 | ||
1751 | if (physmem_map(fb_ph_addr + fb_offset, fb_addr, |
1761 | if (physmem_map(fb_ph_addr + fb_offset, fb_addr, |
1752 | ALIGN_UP(fbsize, PAGE_SIZE) >> PAGE_WIDTH, AS_AREA_READ | AS_AREA_WRITE) != 0) |
1762 | ALIGN_UP(fbsize, PAGE_SIZE) >> PAGE_WIDTH, AS_AREA_READ | AS_AREA_WRITE) != 0) |
1753 | return -1; |
1763 | return -1; |
1754 | 1764 | ||
1755 | if (screen_init(fb_addr, fb_width, fb_height, fb_scanline, fb_visual)) |
1765 | if (screen_init(fb_addr, fb_width, fb_height, fb_scanline, fb_visual)) |
1756 | return 0; |
1766 | return 0; |
1757 | 1767 | ||
1758 | return -1; |
1768 | return -1; |
1759 | } |
1769 | } |
1760 | 1770 | ||
1761 | /** |
1771 | /** |
1762 | * @} |
1772 | * @} |