Rev 2787 | Rev 4377 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
| Rev 2787 | Rev 3684 | ||
|---|---|---|---|
| Line 519... | Line 519... | ||
| 519 | * @param scan Bytes per one scanline |
519 | * @param scan Bytes per one scanline |
| 520 | * @param invert_colors Inverted colors. |
520 | * @param invert_colors Inverted colors. |
| 521 | * |
521 | * |
| 522 | */ |
522 | */ |
| 523 | static bool |
523 | static bool |
| 524 | screen_init(void *addr, unsigned int xres, unsigned int yres, |
524 | screen_init(void *addr, unsigned int offset, unsigned int xres, |
| 525 | unsigned int scan, unsigned int visual, bool invert_colors) |
525 | unsigned int yres, unsigned int scan, unsigned int visual, |
| - | 526 | bool invert_colors) |
|
| 526 | { |
527 | { |
| 527 | switch (visual) { |
528 | switch (visual) { |
| 528 | case VISUAL_INDIRECT_8: |
529 | case VISUAL_INDIRECT_8: |
| 529 | screen.rgb2scr = rgb_byte8; |
530 | screen.rgb2scr = rgb_byte8; |
| 530 | screen.scr2rgb = byte8_rgb; |
531 | screen.scr2rgb = byte8_rgb; |
| Line 562... | Line 563... | ||
| 562 | break; |
563 | break; |
| 563 | default: |
564 | default: |
| 564 | return false; |
565 | return false; |
| 565 | } |
566 | } |
| 566 | 567 | ||
| 567 | screen.fbaddress = (unsigned char *) addr; |
568 | screen.fbaddress = (unsigned char *) (((uintptr_t) addr) + offset); |
| 568 | screen.xres = xres; |
569 | screen.xres = xres; |
| 569 | screen.yres = yres; |
570 | screen.yres = yres; |
| 570 | screen.scanline = scan; |
571 | screen.scanline = scan; |
| 571 | screen.invert_colors = invert_colors; |
572 | screen.invert_colors = invert_colors; |
| 572 | 573 | ||
| Line 1351... | Line 1352... | ||
| 1351 | void *fb_ph_addr; |
1352 | void *fb_ph_addr; |
| 1352 | unsigned int fb_width; |
1353 | unsigned int fb_width; |
| 1353 | unsigned int fb_height; |
1354 | unsigned int fb_height; |
| 1354 | unsigned int fb_scanline; |
1355 | unsigned int fb_scanline; |
| 1355 | unsigned int fb_visual; |
1356 | unsigned int fb_visual; |
| - | 1357 | unsigned int fb_offset; |
|
| 1356 | bool fb_invert_colors; |
1358 | bool fb_invert_colors; |
| 1357 | void *fb_addr; |
1359 | void *fb_addr; |
| 1358 | size_t asz; |
1360 | size_t asz; |
| 1359 | 1361 | ||
| 1360 | async_set_client_connection(fb_client_connection); |
1362 | async_set_client_connection(fb_client_connection); |
| 1361 | 1363 | ||
| 1362 | fb_ph_addr = (void *) sysinfo_value("fb.address.physical"); |
1364 | fb_ph_addr = (void *) sysinfo_value("fb.address.physical"); |
| - | 1365 | fb_offset = sysinfo_value("fb.offset"); |
|
| 1363 | fb_width = sysinfo_value("fb.width"); |
1366 | fb_width = sysinfo_value("fb.width"); |
| 1364 | fb_height = sysinfo_value("fb.height"); |
1367 | fb_height = sysinfo_value("fb.height"); |
| 1365 | fb_scanline = sysinfo_value("fb.scanline"); |
1368 | fb_scanline = sysinfo_value("fb.scanline"); |
| 1366 | fb_visual = sysinfo_value("fb.visual"); |
1369 | fb_visual = sysinfo_value("fb.visual"); |
| 1367 | fb_invert_colors = sysinfo_value("fb.invert-colors"); |
1370 | fb_invert_colors = sysinfo_value("fb.invert-colors"); |
| 1368 | 1371 | ||
| 1369 | asz = fb_scanline * fb_height; |
1372 | asz = fb_scanline * fb_height; |
| 1370 | fb_addr = as_get_mappable_page(asz); |
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 | PAGE_WIDTH, AS_AREA_READ | AS_AREA_WRITE); |
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 | fb_invert_colors)) |
1379 | fb_invert_colors)) |
| 1377 | return 0; |
1380 | return 0; |
| 1378 | 1381 | ||
| 1379 | return -1; |
1382 | return -1; |
| 1380 | } |
1383 | } |