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