Skip to content

Commit

Permalink
fbutils: add support for RGB24
Browse files Browse the repository at this point in the history
Signed-off-by: Michael Hennerich <michael.hennerich@analog.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: Christopher Larson <kergoth@gmail.com>
  • Loading branch information
mhennerich authored and kergoth committed Feb 15, 2012
1 parent 1fd999e commit d6f68a5
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions tests/fbutils.c
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,7 @@ void setcolor(unsigned colidx, unsigned value)
perror("ioctl FBIOPUTCMAP");
break;
case 2:
case 3:
case 4:
red = (value >> 16) & 0xff;
green = (value >> 8) & 0xff;
Expand Down Expand Up @@ -276,6 +277,17 @@ static inline void __setpixel (union multiptr loc, unsigned xormode, unsigned co
else
*loc.p16 = color;
break;
case 3:
if (xormode) {
*loc.p8++ ^= (color >> 16) & 0xff;
*loc.p8++ ^= (color >> 8) & 0xff;
*loc.p8 ^= color & 0xff;
} else {
*loc.p8++ = (color >> 16) & 0xff;
*loc.p8++ = (color >> 8) & 0xff;
*loc.p8 = color & 0xff;
}
break;
case 4:
if (xormode)
*loc.p32 ^= color;
Expand Down

0 comments on commit d6f68a5

Please sign in to comment.