Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/ic Ignore WSDISPLAYIO_PUTCMAP in WSDISPLAYIO_MODE_EM...



details:   https://anonhg.NetBSD.org/src/rev/be8792ab30ef
branches:  trunk
changeset: 979361:be8792ab30ef
user:      tsutsui <tsutsui%NetBSD.org@localhost>
date:      Sat Dec 26 08:58:03 2020 +0000

description:
Ignore WSDISPLAYIO_PUTCMAP in WSDISPLAYIO_MODE_EMUL, i.e. text mode.

The hardware palette settings are handled by the STI ROM in STI_TEXTMODE
and changing cmap could cause mangled text colors at least on CRX on 425t.
Updating CMAP in EMUL mode isn't expected anyway.

Fixes "red or invisible text" after exiting mlterm-wscons on A1659 CRX.

diffstat:

 sys/dev/ic/sti.c |  14 ++++++++++++--
 1 files changed, 12 insertions(+), 2 deletions(-)

diffs (35 lines):

diff -r a38146f84659 -r be8792ab30ef sys/dev/ic/sti.c
--- a/sys/dev/ic/sti.c  Sat Dec 26 06:27:38 2020 +0000
+++ b/sys/dev/ic/sti.c  Sat Dec 26 08:58:03 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: sti.c,v 1.24 2020/12/25 20:41:24 tsutsui Exp $ */
+/*     $NetBSD: sti.c,v 1.25 2020/12/26 08:58:03 tsutsui Exp $ */
 
 /*     $OpenBSD: sti.c,v 1.61 2009/09/05 14:09:35 miod Exp $   */
 
@@ -35,7 +35,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: sti.c,v 1.24 2020/12/25 20:41:24 tsutsui Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sti.c,v 1.25 2020/12/26 08:58:03 tsutsui Exp $");
 
 #include "wsdisplay.h"
 
@@ -1129,6 +1129,16 @@
        case WSDISPLAYIO_PUTCMAP:
                if (scr->putcmap == NULL || scr->scr_bpp > 8)
                        return ENODEV;
+               if (scr->scr_wsmode == WSDISPLAYIO_MODE_EMUL) {
+                       /*
+                        * The hardware palette settings are handled by
+                        * the STI ROM in STI_TEXTMODE and changing cmap
+                        * could cause mangled text colors at least on CRX.
+                        * Updating CMAP in EMUL mode isn't expected anyway
+                        * so just ignore it.
+                        */
+                       return 0;
+               }
                cmapp = (struct wsdisplay_cmap *)data;
                idx = cmapp->index;
                count = cmapp->count;



Home | Main Index | Thread Index | Old Index