Changes in uspace/srv/hid/fb/port/kfb.c [aaa77ba0:7c014d1] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/hid/fb/port/kfb.c
raaa77ba0 r7c014d1 409 409 charfield_t *field = screenbuffer_field_at(vp->backbuf, col, row); 410 410 411 pixel_t bgcolor = 0;412 pixel_t fgcolor = 0;411 pixel_t bgcolor; 412 pixel_t fgcolor; 413 413 attrs_rgb(field->attrs, &bgcolor, &fgcolor); 414 414 … … 422 422 { 423 423 if (kfb.backbuf == NULL) { 424 kfb.backbuf = 425 malloc(kfb.width * kfb.height * kfb.pixel_bytes); 424 kfb.backbuf = malloc(kfb.size); 426 425 if (kfb.backbuf == NULL) 427 426 return ENOMEM; 428 427 } 429 428 430 for (sysarg_t y = 0; y < kfb.height; y++) 431 memcpy(kfb.backbuf + y * kfb.width * kfb.pixel_bytes, 432 kfb.addr + FB_POS(0, y), kfb.width * kfb.pixel_bytes); 433 429 memcpy(kfb.backbuf, kfb.addr, kfb.size); 434 430 return EOK; 435 431 } … … 440 436 return ENOENT; 441 437 442 for (sysarg_t y = 0; y < kfb.height; y++) 443 memcpy(kfb.addr + FB_POS(0, y), 444 kfb.backbuf + y * kfb.width * kfb.pixel_bytes, 445 kfb.width * kfb.pixel_bytes); 446 438 memcpy(kfb.addr, kfb.backbuf, kfb.size); 447 439 return EOK; 448 440 } … … 525 517 } 526 518 527 pixel_t bgcolor = 0;528 pixel_t fgcolor = 0;519 pixel_t bgcolor; 520 pixel_t fgcolor; 529 521 attrs_rgb(vp->attrs, &bgcolor, &fgcolor); 530 522 … … 756 748 757 749 kfb.size = scanline * height; 758 759 rc = physmem_map((void *) paddr + offset, 760 ALIGN_UP(kfb.size, PAGE_SIZE) >> PAGE_WIDTH, 761 AS_AREA_READ | AS_AREA_WRITE, (void *) &kfb.addr); 750 kfb.addr = as_get_mappable_page(kfb.size); 751 if (kfb.addr == NULL) { 752 free(kfb.glyphs); 753 return ENOMEM; 754 } 755 756 rc = physmem_map((void *) paddr + offset, kfb.addr, 757 ALIGN_UP(kfb.size, PAGE_SIZE) >> PAGE_WIDTH, AS_AREA_READ | AS_AREA_WRITE); 762 758 if (rc != EOK) { 763 759 free(kfb.glyphs);
Note:
See TracChangeset
for help on using the changeset viewer.