diff options
author | Ralf Baechle <ralf@linux-mips.org> | 2000-03-12 23:15:27 +0000 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 2000-03-12 23:15:27 +0000 |
commit | ae38fd1e4c98588314a42097c5a5e77dcef23561 (patch) | |
tree | f9f10c203bb9e5fbad4810d1f8774c08dfad20ff /drivers/video/fbcmap.c | |
parent | 466a823d79f41d0713b272e48fd73e494b0588e0 (diff) |
Merge with Linux 2.3.50.
Diffstat (limited to 'drivers/video/fbcmap.c')
-rw-r--r-- | drivers/video/fbcmap.c | 45 |
1 files changed, 24 insertions, 21 deletions
diff --git a/drivers/video/fbcmap.c b/drivers/video/fbcmap.c index 9207df06e..264cf14a7 100644 --- a/drivers/video/fbcmap.c +++ b/drivers/video/fbcmap.c @@ -16,22 +16,6 @@ #include <asm/uaccess.h> - -static void memcpy_fs(int fsfromto, void *to, void *from, int len) -{ - switch (fsfromto) { - case 0: - memcpy(to, from, len); - return; - case 1: - copy_from_user(to, from, len); - return; - case 2: - copy_to_user(to, from, len); - return; - } -} - static u16 red2[] = { 0x0000, 0xaaaa }; @@ -148,11 +132,30 @@ void fb_copy_cmap(struct fb_cmap *from, struct fb_cmap *to, int fsfromto) if (size < 0) return; size *= sizeof(u16); - memcpy_fs(fsfromto, to->red+tooff, from->red+fromoff, size); - memcpy_fs(fsfromto, to->green+tooff, from->green+fromoff, size); - memcpy_fs(fsfromto, to->blue+tooff, from->blue+fromoff, size); - if (from->transp && to->transp) - memcpy_fs(fsfromto, to->transp+tooff, from->transp+fromoff, size); + + switch (fsfromto) { + case 0: + memcpy(to->red+tooff, from->red+fromoff, size); + memcpy(to->green+tooff, from->green+fromoff, size); + memcpy(to->blue+tooff, from->blue+fromoff, size); + if (from->transp && to->transp) + memcpy(to->transp+tooff, from->transp+fromoff, size); + break; + case 1: + copy_from_user(to->red+tooff, from->red+fromoff, size); + copy_from_user(to->green+tooff, from->green+fromoff, size); + copy_from_user(to->blue+tooff, from->blue+fromoff, size); + if (from->transp && to->transp) + copy_from_user(to->transp+tooff, from->transp+fromoff, size); + break; + case 2: + copy_to_user(to->red+tooff, from->red+fromoff, size); + copy_to_user(to->green+tooff, from->green+fromoff, size); + copy_to_user(to->blue+tooff, from->blue+fromoff, size); + if (from->transp && to->transp) + copy_to_user(to->transp+tooff, from->transp+fromoff, size); + break; + } } |