diff options
| author | rin <rin@NetBSD.org> | 2019-07-29 16:17:29 +0000 |
|---|---|---|
| committer | rin <rin@NetBSD.org> | 2019-07-29 16:17:29 +0000 |
| commit | 055aa67cc71b3e6336faba42d82d43cee54d0d4e (patch) | |
| tree | feefbd5ebc74666f005d0311bb847b6e41e9e60e /sys/dev/rasops/rasops.c | |
| parent | e8cbedfc6aed7e469de1ecca232e38e07ca023e8 (diff) | |
Hmmm, color was still strange for 24bpp on little endian machine,
only when font width is 12.
We need to use different devcmap for that case, if we wish to share
codes for other depths/font widths as possible as we can.
XXX
What should we do for big endian? I have no big endian machines with
24bpp framebuffer...
Diffstat (limited to 'sys/dev/rasops/rasops.c')
| -rw-r--r-- | sys/dev/rasops/rasops.c | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/sys/dev/rasops/rasops.c b/sys/dev/rasops/rasops.c index 0b1e04289c3..4cfe4c50d70 100644 --- a/sys/dev/rasops/rasops.c +++ b/sys/dev/rasops/rasops.c @@ -1,4 +1,4 @@ -/* $NetBSD: rasops.c,v 1.96 2019/07/29 14:43:14 rin Exp $ */ +/* $NetBSD: rasops.c,v 1.97 2019/07/29 16:17:29 rin Exp $ */ /*- * Copyright (c) 1999 The NetBSD Foundation, Inc. @@ -30,7 +30,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: rasops.c,v 1.96 2019/07/29 14:43:14 rin Exp $"); +__KERNEL_RCSID(0, "$NetBSD: rasops.c,v 1.97 2019/07/29 16:17:29 rin Exp $"); #include "opt_rasops.h" #include "rasops_glue.h" @@ -901,8 +901,18 @@ rasops_init_devcmap(struct rasops_info *ri) c |= c << 16; else if (ri->ri_depth == 24) { #if BYTE_ORDER == LITTLE_ENDIAN - c = (c & 0x0000ff) << 16 | (c & 0x00ff00) | - (c & 0xff0000) >> 16; +# ifndef RASOPS_SMALL + if (ri->ri_font->fontwidth != 12) +# endif + c = (c & 0x0000ff) << 16 | (c & 0x00ff00) | + (c & 0xff0000) >> 16; +# ifndef RASOPS_SMALL + else + c = (c & 0x0000ff) | (c & 0x00ff00) << 8 | + (c & 0xff0000) >> 8; +# endif +#else + /* XXXRO What should we do here? */ #endif c |= (c & 0xff) << 24; } |
