Module Name: src Committed By: rin Date: Mon Jul 29 16:17:29 UTC 2019
Modified Files: src/sys/dev/rasops: rasops.c rasops24.c Log Message: 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... To generate a diff of this commit: cvs rdiff -u -r1.96 -r1.97 src/sys/dev/rasops/rasops.c cvs rdiff -u -r1.37 -r1.38 src/sys/dev/rasops/rasops24.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/dev/rasops/rasops.c diff -u src/sys/dev/rasops/rasops.c:1.96 src/sys/dev/rasops/rasops.c:1.97 --- src/sys/dev/rasops/rasops.c:1.96 Mon Jul 29 14:43:14 2019 +++ src/sys/dev/rasops/rasops.c Mon Jul 29 16:17:29 2019 @@ -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 * 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; } Index: src/sys/dev/rasops/rasops24.c diff -u src/sys/dev/rasops/rasops24.c:1.37 src/sys/dev/rasops/rasops24.c:1.38 --- src/sys/dev/rasops/rasops24.c:1.37 Mon Jul 29 14:06:32 2019 +++ src/sys/dev/rasops/rasops24.c Mon Jul 29 16:17:29 2019 @@ -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;