Changeset c7f9037 in mainline


Ignore:
Timestamp:
2011-09-09T23:26:18Z (13 years ago)
Author:
Martin Decky <martin@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
cccc091
Parents:
b7c33b0
Message:

avoid touching the whole scanline
(this can be harmful on some framebuffers, e.g. on Sun Ultra 60)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/srv/hid/fb/port/kfb.c

    rb7c33b0 rc7f9037  
    422422{
    423423        if (kfb.backbuf == NULL) {
    424                 kfb.backbuf = malloc(kfb.size);
     424                kfb.backbuf =
     425                    malloc(kfb.width * kfb.height * kfb.pixel_bytes);
    425426                if (kfb.backbuf == NULL)
    426427                        return ENOMEM;
    427428        }
    428429       
    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       
    430434        return EOK;
    431435}
     
    436440                return ENOENT;
    437441       
    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       
    439447        return EOK;
    440448}
Note: See TracChangeset for help on using the changeset viewer.