Changes in kernel/genarch/src/fb/fb.c [19490ce:b9c7425] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/genarch/src/fb/fb.c
r19490ce rb9c7425 458 458 * 459 459 */ 460 void fb_init(fb_properties_t *props) 461 { 460 bool fb_init(fb_properties_t *props) 461 { 462 ASSERT(props); 463 ASSERT(props->x > 0); 464 ASSERT(props->y > 0); 465 ASSERT(props->scan > 0); 466 462 467 switch (props->visual) { 463 468 case VISUAL_INDIRECT_8: … … 506 511 break; 507 512 default: 508 panic("Unsupported visual."); 513 LOG("Unsupported visual."); 514 return false; 509 515 } 510 516 … … 536 542 size_t glyphsize = FONT_GLYPHS * glyphbytes; 537 543 544 fb_addr = (uint8_t *) hw_map((uintptr_t) props->addr, fbsize); 545 if (!fb_addr) { 546 LOG("Unable to map framebuffer."); 547 return false; 548 } 549 538 550 backbuf = (uint16_t *) malloc(bbsize, 0); 539 if (!backbuf) 540 panic("Unable to allocate backbuffer."); 551 if (!backbuf) { 552 LOG("Unable to allocate backbuffer."); 553 return false; 554 } 541 555 542 556 glyphs = (uint8_t *) malloc(glyphsize, 0); 543 if (!glyphs) 544 panic("Unable to allocate glyphs."); 557 if (!glyphs) { 558 free(backbuf); 559 LOG("Unable to allocate glyphs."); 560 return false; 561 } 545 562 546 563 bgscan = malloc(bgscanbytes, 0); 547 if (!bgscan) 548 panic("Unable to allocate background pixel."); 564 if (!bgscan) { 565 free(glyphs); 566 free(backbuf); 567 LOG("Unable to allocate background pixel."); 568 return false; 569 } 549 570 550 571 memsetw(backbuf, cols * rows, 0); 551 552 572 glyphs_render(); 553 554 fb_addr = (uint8_t *) hw_map((uintptr_t) props->addr, fbsize);555 573 556 574 sysinfo_set_item_val("fb", NULL, true); … … 565 583 566 584 outdev_initialize("fb", &fb_console, &fb_ops); 567 stdout = &fb_console; 585 stdout_wire(&fb_console); 586 587 return true; 568 588 } 569 589
Note:
See TracChangeset
for help on using the changeset viewer.