Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/dev/rasops Hmmm, color was still strange for 24bpp on li...



details:   https://anonhg.NetBSD.org/src/rev/906f130b41b3
branches:  trunk
changeset: 462256:906f130b41b3
user:      rin <rin%NetBSD.org@localhost>
date:      Mon Jul 29 16:17:29 2019 +0000

description:
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:

 sys/dev/rasops/rasops.c   |  18 ++++++++++++++----
 sys/dev/rasops/rasops24.c |  12 ++++++++++--
 2 files changed, 24 insertions(+), 6 deletions(-)

diffs (72 lines):

diff -r e6b95d6a59ff -r 906f130b41b3 sys/dev/rasops/rasops.c
--- a/sys/dev/rasops/rasops.c   Mon Jul 29 14:59:25 2019 +0000
+++ b/sys/dev/rasops/rasops.c   Mon Jul 29 16:17:29 2019 +0000
@@ -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 @@
                        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 -r e6b95d6a59ff -r 906f130b41b3 sys/dev/rasops/rasops24.c
--- a/sys/dev/rasops/rasops24.c Mon Jul 29 14:59:25 2019 +0000
+++ b/sys/dev/rasops/rasops24.c Mon Jul 29 16:17:29 2019 +0000
@@ -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 @@
 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;
 



Home | Main Index | Thread Index | Old Index