Changeset d9fae235 in mainline for uspace/srv/hid/fb
- Timestamp:
- 2010-04-17T01:28:38Z (16 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 9d6bfa5
- Parents:
- 9256ad29
- Location:
- uspace/srv/hid/fb
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/hid/fb/ega.c
r9256ad29 rd9fae235 415 415 void *ega_ph_addr; 416 416 size_t sz; 417 418 ega_ph_addr = (void *) sysinfo_value("fb.address.physical"); 419 scr_width = sysinfo_value("fb.width"); 420 scr_height = sysinfo_value("fb.height"); 421 422 if (sysinfo_value("fb.blinking")) { 417 418 sysarg_t paddr; 419 if (sysinfo_get_value("fb.address.physical", &paddr) != EOK) 420 return -1; 421 422 sysarg_t width; 423 if (sysinfo_get_value("fb.width", &width) != EOK) 424 return -1; 425 426 sysarg_t height; 427 if (sysinfo_get_value("fb.width", &height) != EOK) 428 return -1; 429 430 sysarg_t blinking; 431 if (sysinfo_get_value("fb.blinking", &blinking) != EOK) 432 blinking = false; 433 434 ega_ph_addr = (void *) paddr; 435 scr_width = width; 436 scr_height = height; 437 if (blinking) { 423 438 ega_normal_color &= 0x77; 424 439 ega_inverted_color &= 0x77; 425 440 } 426 441 427 442 style = NORMAL_COLOR; 428 443 429 444 iospace_enable(task_get_id(), (void *) EGA_IO_BASE, 2); 430 445 431 446 sz = scr_width * scr_height * 2; 432 447 scr_addr = as_get_mappable_page(sz); 433 448 434 449 if (physmem_map(ega_ph_addr, scr_addr, ALIGN_UP(sz, PAGE_SIZE) >> 435 450 PAGE_WIDTH, AS_AREA_READ | AS_AREA_WRITE) != 0) -
uspace/srv/hid/fb/fb.c
r9256ad29 rd9fae235 1756 1756 async_set_client_connection(fb_client_connection); 1757 1757 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; 1758 sysarg_t fb_ph_addr; 1759 if (sysinfo_get_value("fb.address.physical", &fb_ph_addr) != EOK) 1760 return -1; 1761 1762 sysarg_t fb_offset; 1763 if (sysinfo_get_value("fb.offset", &fb_offset) != EOK) 1764 fb_offset = 0; 1765 1766 sysarg_t fb_width; 1767 if (sysinfo_get_value("fb.width", &fb_width) != EOK) 1768 return -1; 1769 1770 sysarg_t fb_height; 1771 if (sysinfo_get_value("fb.height", &fb_height) != EOK) 1772 return -1; 1773 1774 sysarg_t fb_scanline; 1775 if (sysinfo_get_value("fb.scanline", &fb_scanline) != EOK) 1776 return -1; 1777 1778 sysarg_t fb_visual; 1779 if (sysinfo_get_value("fb.visual", &fb_visual) != EOK) 1780 return -1; 1781 1782 sysarg_t fbsize = fb_scanline * fb_height; 1766 1783 void *fb_addr = as_get_mappable_page(fbsize); 1767 1768 if (physmem_map( fb_ph_addr + fb_offset, fb_addr,1784 1785 if (physmem_map((void *) fb_ph_addr + fb_offset, fb_addr, 1769 1786 ALIGN_UP(fbsize, PAGE_SIZE) >> PAGE_WIDTH, AS_AREA_READ | AS_AREA_WRITE) != 0) 1770 1787 return -1; 1771 1788 1772 1789 if (screen_init(fb_addr, fb_width, fb_height, fb_scanline, fb_visual)) 1773 1790 return 0; 1774 1791 1775 1792 return -1; 1776 1793 } -
uspace/srv/hid/fb/main.c
r9256ad29 rd9fae235 60 60 int main(int argc, char *argv[]) 61 61 { 62 printf( NAME ": HelenOS Framebuffer service\n");62 printf("%s: HelenOS Framebuffer service\n", NAME); 63 63 64 ipcarg_t phonead;65 64 bool initialized = false; 65 sysarg_t fb_present; 66 sysarg_t fb_kind; 67 68 if (sysinfo_get_value("fb", &fb_present) != EOK) 69 fb_present = false; 70 71 if (sysinfo_get_value("fb.kind", &fb_kind) != EOK) { 72 printf("%s: Unable to detect framebuffer configuration\n", NAME); 73 return -1; 74 } 66 75 67 76 #ifdef FB_ENABLED 68 if ( sysinfo_value("fb.kind") == 1) {77 if ((!initialized) && (fb_kind == 1)) { 69 78 if (fb_init() == 0) 70 79 initialized = true; … … 72 81 #endif 73 82 #ifdef EGA_ENABLED 74 if ((!initialized) && ( sysinfo_value("fb.kind")== 2)) {83 if ((!initialized) && (fb_kind == 2)) { 75 84 if (ega_init() == 0) 76 85 initialized = true; … … 78 87 #endif 79 88 #ifdef MSIM_ENABLED 80 if ((!initialized) && ( sysinfo_value("fb.kind")== 3)) {89 if ((!initialized) && (fb_kind == 3)) { 81 90 if (msim_init() == 0) 82 91 initialized = true; … … 84 93 #endif 85 94 #ifdef SGCN_ENABLED 86 if ((!initialized) && ( sysinfo_value("fb.kind")== 4)) {95 if ((!initialized) && (fb_kind == 4)) { 87 96 if (sgcn_init() == 0) 88 97 initialized = true; … … 90 99 #endif 91 100 #ifdef NIAGARA_ENABLED 92 if ((!initialized) && ( sysinfo_value("fb.kind")== 5)) {101 if ((!initialized) && (fb_kind == 5)) { 93 102 if (niagara_init() == 0) 94 103 initialized = true; … … 96 105 #endif 97 106 #ifdef SKI_ENABLED 98 if ((!initialized) && ( sysinfo_value("fb") != true)) {107 if ((!initialized) && (!fb_present)) { 99 108 if (ski_init() == 0) 100 109 initialized = true; … … 105 114 return -1; 106 115 116 ipcarg_t phonead; 107 117 if (ipc_connect_to_me(PHONE_NS, SERVICE_VIDEO, 0, 0, &phonead) != 0) 108 118 return -1; 109 119 110 printf( NAME ": Accepting connections\n");120 printf("%s: Accepting connections\n", NAME); 111 121 async_manager(); 112 122 -
uspace/srv/hid/fb/msim.c
r9256ad29 rd9fae235 29 29 30 30 /** @defgroup msimfb MSIM text console 31 * @brief HelenOS MSIM text console.31 * @brief HelenOS MSIM text console. 32 32 * @ingroup fbs 33 33 * @{ 34 */ 34 */ 35 35 /** @file 36 36 */ … … 41 41 #include <as.h> 42 42 #include <ddi.h> 43 #include <errno.h> 43 44 44 45 #include "serial_console.h" … … 57 58 int msim_init(void) 58 59 { 59 void *phys_addr = (void *) sysinfo_value("fb.address.physical"); 60 sysarg_t phys_addr; 61 if (sysinfo_get_value("fb.address.physical", &phys_addr) != EOK) 62 return -1; 63 60 64 virt_addr = (char *) as_get_mappable_page(1); 61 65 62 if (physmem_map(phys_addr, virt_addr, 1, AS_AREA_READ | AS_AREA_WRITE) != 0) 66 if (physmem_map((void *) phys_addr, virt_addr, 1, 67 AS_AREA_READ | AS_AREA_WRITE) != 0) 63 68 return -1; 64 69 … … 69 74 } 70 75 71 /** 72 * @} 76 /** @} 73 77 */ -
uspace/srv/hid/fb/niagara.c
r9256ad29 rd9fae235 91 91 int niagara_init(void) 92 92 { 93 sysarg_t paddr; 94 if (sysinfo_get_value("niagara.outbuf.address", &paddr) != EOK) 95 return -1; 96 93 97 output_buffer_addr = (uintptr_t) as_get_mappable_page(PAGE_SIZE); 94 int result = physmem_map( 95 (void *) sysinfo_value("niagara.outbuf.address"), 96 (void *) output_buffer_addr, 97 1, AS_AREA_READ | AS_AREA_WRITE); 98 int result = physmem_map((void *) paddr, 99 (void *) output_buffer_addr, 1, 100 AS_AREA_READ | AS_AREA_WRITE); 98 101 99 102 if (result != 0) { -
uspace/srv/hid/fb/sgcn.c
r9256ad29 rd9fae235 122 122 int sgcn_init(void) 123 123 { 124 sram_virt_addr = (uintptr_t) as_get_mappable_page(sysinfo_value("sram.area.size")); 124 sysarg_t sram_paddr; 125 if (sysinfo_get_value("sram.address.physical", &sram_paddr) != EOK) 126 return -1; 125 127 126 if (physmem_map((void *) sysinfo_value("sram.address.physical"), 127 (void *) sram_virt_addr, sysinfo_value("sram.area.size") / PAGE_SIZE, 128 AS_AREA_READ | AS_AREA_WRITE) != 0) 128 sysarg_t sram_size; 129 if (sysinfo_get_value("sram.area.size", &sram_size) != EOK) 130 return -1; 131 132 if (sysinfo_get_value("sram.buffer.offset", &sram_buffer_offset) != EOK) 133 sram_buffer_offset = 0; 134 135 sram_virt_addr = (uintptr_t) as_get_mappable_page(sram_size); 136 137 if (physmem_map((void *) sram_paddr, (void *) sram_virt_addr, 138 sram_size / PAGE_SIZE, AS_AREA_READ | AS_AREA_WRITE) != 0) 129 139 return -1; 130 140 131 141 serial_console_init(sgcn_putc, WIDTH, HEIGHT); 132 133 sram_buffer_offset = sysinfo_value("sram.buffer.offset");134 142 135 143 async_set_client_connection(serial_client_connection);
Note:
See TracChangeset
for help on using the changeset viewer.
