Changes in uspace/srv/hid/fb/fb.c [369a5f8:19f857a] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/hid/fb/fb.c
r369a5f8 r19f857a 59 59 #include <stdio.h> 60 60 #include <byteorder.h> 61 #include <io/screenbuffer.h>62 61 63 62 #include "font-8x16.h" 64 63 #include "fb.h" 65 64 #include "main.h" 65 #include "../console/screenbuffer.h" 66 66 #include "ppm.h" 67 67 … … 72 72 #define DEFAULT_FGCOLOR 0x000000 73 73 74 #define GLYPH_UNAVAIL '?'75 76 #define MAX_ANIM_LEN 877 #define MAX_ANIMATIONS 478 #define MAX_PIXMAPS 256 /**< Maximum number of saved pixmaps */79 #define MAX_VIEWPORTS 128 /**< Viewport is a rectangular area on the screen */74 #define GLYPH_UNAVAIL '?' 75 76 #define MAX_ANIM_LEN 8 77 #define MAX_ANIMATIONS 4 78 #define MAX_PIXMAPS 256 /**< Maximum number of saved pixmaps */ 79 #define MAX_VIEWPORTS 128 /**< Viewport is a rectangular area on the screen */ 80 80 81 81 /** Function to render a pixel from a RGB value. */ … … 956 956 bb_cell_t *bbp; 957 957 attrs_t *a; 958 attr_rgb_t rgb; 958 959 959 960 for (j = 0; j < h; j++) { … … 965 966 966 967 a = &data[j * w + i].attrs; 967 968 attr_rgb_t rgb;969 rgb.fg_color = 0;970 rgb.bg_color = 0;971 968 rgb_from_attr(&rgb, a); 972 969 … … 1514 1511 rgb->bg_color = color_table[COLOR_WHITE]; 1515 1512 break; 1516 case STYLE_INVERTED:1517 rgb->fg_color = color_table[COLOR_WHITE];1518 rgb->bg_color = color_table[COLOR_BLACK];1519 break;1520 case STYLE_SELECTED:1521 rgb->fg_color = color_table[COLOR_WHITE];1522 rgb->bg_color = color_table[COLOR_RED];1523 break;1524 1513 default: 1525 1514 return EINVAL; 1526 1515 } 1527 1516 1528 1517 return EOK; 1529 1518 } … … 1767 1756 async_set_client_connection(fb_client_connection); 1768 1757 1769 sysarg_t fb_ph_addr; 1770 if (sysinfo_get_value("fb.address.physical", &fb_ph_addr) != EOK) 1771 return -1; 1772 1773 sysarg_t fb_offset; 1774 if (sysinfo_get_value("fb.offset", &fb_offset) != EOK) 1775 fb_offset = 0; 1776 1777 sysarg_t fb_width; 1778 if (sysinfo_get_value("fb.width", &fb_width) != EOK) 1779 return -1; 1780 1781 sysarg_t fb_height; 1782 if (sysinfo_get_value("fb.height", &fb_height) != EOK) 1783 return -1; 1784 1785 sysarg_t fb_scanline; 1786 if (sysinfo_get_value("fb.scanline", &fb_scanline) != EOK) 1787 return -1; 1788 1789 sysarg_t fb_visual; 1790 if (sysinfo_get_value("fb.visual", &fb_visual) != EOK) 1791 return -1; 1792 1793 sysarg_t fbsize = fb_scanline * fb_height; 1758 void *fb_ph_addr = (void *) sysinfo_value("fb.address.physical"); 1759 unsigned int fb_offset = sysinfo_value("fb.offset"); 1760 unsigned int fb_width = sysinfo_value("fb.width"); 1761 unsigned int fb_height = sysinfo_value("fb.height"); 1762 unsigned int fb_scanline = sysinfo_value("fb.scanline"); 1763 unsigned int fb_visual = sysinfo_value("fb.visual"); 1764 1765 unsigned int fbsize = fb_scanline * fb_height; 1794 1766 void *fb_addr = as_get_mappable_page(fbsize); 1795 1796 if (physmem_map( (void *)fb_ph_addr + fb_offset, fb_addr,1767 1768 if (physmem_map(fb_ph_addr + fb_offset, fb_addr, 1797 1769 ALIGN_UP(fbsize, PAGE_SIZE) >> PAGE_WIDTH, AS_AREA_READ | AS_AREA_WRITE) != 0) 1798 1770 return -1; 1799 1771 1800 1772 if (screen_init(fb_addr, fb_width, fb_height, fb_scanline, fb_visual)) 1801 1773 return 0; 1802 1774 1803 1775 return -1; 1804 1776 }
Note:
See TracChangeset
for help on using the changeset viewer.