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