summaryrefslogtreecommitdiff
path: root/sys/dev/rasops
diff options
context:
space:
mode:
authorrin <rin@NetBSD.org>2019-07-29 16:17:29 +0000
committerrin <rin@NetBSD.org>2019-07-29 16:17:29 +0000
commit055aa67cc71b3e6336faba42d82d43cee54d0d4e (patch)
treefeefbd5ebc74666f005d0311bb847b6e41e9e60e /sys/dev/rasops
parente8cbedfc6aed7e469de1ecca232e38e07ca023e8 (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')
-rw-r--r--sys/dev/rasops/rasops.c18
-rw-r--r--sys/dev/rasops/rasops24.c12
2 files changed, 24 insertions, 6 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;
}
diff --git a/sys/dev/rasops/rasops24.c b/sys/dev/rasops/rasops24.c
index 78e7f158afc..c6187891cac 100644
--- a/sys/dev/rasops/rasops24.c
+++ b/sys/dev/rasops/rasops24.c
@@ -1,4 +1,4 @@
-/* $NetBSD: rasops24.c,v 1.37 2019/07/29 14:06:32 rin Exp $ */
+/* $NetBSD: rasops24.c,v 1.38 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: rasops24.c,v 1.37 2019/07/29 14:06:32 rin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rasops24.c,v 1.38 2019/07/29 16:17:29 rin Exp $");
#include "opt_rasops.h"
@@ -80,6 +80,14 @@ void
rasops24_init(struct rasops_info *ri)
{
+#ifndef RASOPS_SMALL
+ /*
+ * Different devcmap's are used depending on font widths,
+ * therefore we need reset stamp here.
+ */
+ stamp_attr = 0;
+#endif
+
if (ri->ri_rnum == 0) {
ri->ri_rnum = ri->ri_gnum = ri->ri_bnum = 8;