Changeset 20eb5e4d in mainline
- Timestamp:
- 2008-12-07T00:41:59Z (16 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 5d9430d7
- Parents:
- 2b1f860
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/arch/sparc64/src/drivers/scr.c
r2b1f860 r20eb5e4d 79 79 80 80 uintptr_t fb_addr; 81 unsigned int fb_offset = 0; 81 82 uint32_t fb_width = 0; 82 83 uint32_t fb_height = 0; … … 168 169 } 169 170 171 fb_offset = 4 * 0x2000; 172 170 173 switch (fb_depth) { 171 174 case 8: 172 175 fb_scanline = fb_linebytes * (fb_depth >> 3); 173 visual = VISUAL_ SB1500_PALETTE;176 visual = VISUAL_INDIRECT_8; 174 177 break; 175 178 case 16: … … 226 229 fb_properties_t props = { 227 230 .addr = fb_addr, 228 .offset = 0,231 .offset = fb_offset, 229 232 .x = fb_width, 230 233 .y = fb_height, -
kernel/genarch/include/fb/visuals.h
r2b1f860 r20eb5e4d 45 45 46 46 #define VISUAL_BGR_0_8_8_8 6 47 #define VISUAL_SB1500_PALETTE 748 47 49 48 #endif -
kernel/genarch/src/fb/fb.c
r2b1f860 r20eb5e4d 190 190 *((uint8_t *) dst) = RED(rgb, 3) << 5 | GREEN(rgb, 2) << 3 | 191 191 BLUE(rgb, 3); 192 }193 194 static void sb1500rgb_byte8(void *dst, int rgb)195 {196 if (RED(rgb, 1) && GREEN(rgb, 1) && BLUE(rgb, 1))197 *((uint8_t *) dst) = 255;198 else if (RED(rgb, 1) && GREEN(rgb, 1))199 *((uint8_t *) dst) = 150;200 else if (GREEN(rgb, 1) && BLUE(rgb, 1))201 *((uint8_t *) dst) = 47;202 else if (RED(rgb, 1) && BLUE(rgb, 1))203 *((uint8_t *) dst) = 48;204 else if (RED(rgb, 1))205 *((uint8_t *) dst) = 32;206 else if (GREEN(rgb, 1))207 *((uint8_t *) dst) = 47;208 else if (BLUE(rgb, 1))209 *((uint8_t *) dst) = 2;210 else211 *((uint8_t *) dst) = 1;212 192 } 213 193 … … 467 447 pixelbytes = 1; 468 448 break; 469 case VISUAL_SB1500_PALETTE:470 rgb2scr = sb1500rgb_byte8;471 scr2rgb = byte8_rgb;472 pixelbytes = 1;473 break;474 449 case VISUAL_RGB_5_5_5: 475 450 rgb2scr = rgb_byte555; … … 506 481 } 507 482 508 unsigned int fbsize = props->scan * props->y + props->offset;483 unsigned int fbsize = props->scan * props->y; 509 484 510 485 /* Map the framebuffer */ 511 fbaddress = (uint8_t *) hw_map((uintptr_t) props->addr, fbsize); 486 fbaddress = (uint8_t *) hw_map((uintptr_t) props->addr + props->offset, 487 fbsize); 512 488 fbaddress += props->offset; 513 489 … … 532 508 sysinfo_set_item_val("fb.visual", NULL, props->visual); 533 509 sysinfo_set_item_val("fb.address.physical", NULL, props->addr); 510 sysinfo_set_item_val("fb.offset", NULL, props->offset); 534 511 sysinfo_set_item_val("fb.invert-colors", NULL, invert_colors); 535 512 -
uspace/srv/fb/fb.c
r2b1f860 r20eb5e4d 522 522 */ 523 523 static bool 524 screen_init(void *addr, unsigned int xres, unsigned int yres, 525 unsigned int scan, unsigned int visual, bool invert_colors) 524 screen_init(void *addr, unsigned int offset, unsigned int xres, 525 unsigned int yres, unsigned int scan, unsigned int visual, 526 bool invert_colors) 526 527 { 527 528 switch (visual) { … … 565 566 } 566 567 567 screen.fbaddress = (unsigned char *) addr;568 screen.fbaddress = (unsigned char *) (((uintptr_t) addr) + offset); 568 569 screen.xres = xres; 569 570 screen.yres = yres; … … 1354 1355 unsigned int fb_scanline; 1355 1356 unsigned int fb_visual; 1357 unsigned int fb_offset; 1356 1358 bool fb_invert_colors; 1357 1359 void *fb_addr; … … 1361 1363 1362 1364 fb_ph_addr = (void *) sysinfo_value("fb.address.physical"); 1365 fb_offset = sysinfo_value("fb.offset"); 1363 1366 fb_width = sysinfo_value("fb.width"); 1364 1367 fb_height = sysinfo_value("fb.height"); … … 1370 1373 fb_addr = as_get_mappable_page(asz); 1371 1374 1372 physmem_map(fb_ph_addr , fb_addr, ALIGN_UP(asz, PAGE_SIZE) >>1375 physmem_map(fb_ph_addr + fb_offset, fb_addr, ALIGN_UP(asz, PAGE_SIZE) >> 1373 1376 PAGE_WIDTH, AS_AREA_READ | AS_AREA_WRITE); 1374 1377 1375 if (screen_init(fb_addr, fb_ width, fb_height, fb_scanline, fb_visual,1378 if (screen_init(fb_addr, fb_offset, fb_width, fb_height, fb_scanline, fb_visual, 1376 1379 fb_invert_colors)) 1377 1380 return 0;
Note:
See TracChangeset
for help on using the changeset viewer.