Subject: port-sgimips/34759: newport cursor positioned 8 pixels to the left with board rev.5 vc2 rev.0
To: None <port-sgimips-maintainer@netbsd.org, gnats-admin@netbsd.org,>
From: None <frank@phoenix.owl.de>
List: netbsd-bugs
Date: 10/08/2006 16:15:01
>Number:         34759
>Category:       port-sgimips
>Synopsis:       newport cursor positioned 8 pixels to the left with board rev.5 vc2 rev.0
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    port-sgimips-maintainer
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sun Oct 08 16:15:01 +0000 2006
>Originator:     Frank Wille
>Release:        NetBSD-current, October 8th, 2006
>Organization:
>Environment:
NetBSD indy.owl.de 4.99.3 NetBSD 4.99.3 (GENERIC32_IP2x) #1: Sun Oct  8 17:33:04 CEST 2006  frank@compaq.owl.de:/usr/src_current/sys/arch/sgimips/compile/obj/GENERIC32_IP2x sgimips
>Description:
With my newport board the cursor is misplaced one character (8 pixels) to the left, making the last character typed invisible. The behaviour certainly depends on the board- and vc2-revision, as it seems to work for others. Here is my dmesg output:

---8<---
NetBSD 4.99.3 (GENERIC32_IP2x) #1: Sun Oct  8 17:33:04 CEST 2006
frank@compaq.owl.de:/usr/src_current/sys/arch/sgimips/compile/obj/GENERIC32_IP2xtotal memory = 160 MB
(768 KB reserved for ARCS)
avail memory = 151 MB
timecounter: Timecounters tick every 10.000 msec
mainbus0 (root): SGI-IP22 [SGI, 69083e9f], 1 processor
cpu0 at mainbus0: MIPS R4000 CPU (0x422) Rev. 2.2 with MIPS R4010 FPC Rev. 0.0
cpu0: 8KB/16B direct-mapped L1 Instruction cache, 48 TLB entries
cpu0: 8KB/16B direct-mapped write-back L1 Data cache
cpu0: 1024KB/128B direct-mapped write-back L2 Unified cache
ioc0 at mainbus0 addr 0x1fbd9800: rev 0, machine Indy (Guiness), board rev 0
int0 at mainbus0 addr 0x1fbd9880: bus 50MHz, CPU 100MHz
imc0 at mainbus0 addr 0x1fa00000: revision 3
gio0 at imc0
newport0 at gio0 slot 0 addr 0x1f000000: SGI NG1 (board revision 5, cmap revision 5, xmap revision 5, vc2 revision 0), depth 8
[...]
---8<---

As you see this is board revision 5, vc2 revision 0, causing the problem.

>How-To-Repeat:
Just boot an Indy with newport board rev.5 vc2 rev.0 and watch the cursor position.

>Fix:
Maybe checking for vc2 revision 0 should get priority over checking for board revision < 6 in newport.c. Works fine here, but should be tested with other revisions...

--- sys/arch/sgimips/gio/newport.c.orig 2006-10-08 17:31:11.000000000 +0200
+++ sys/arch/sgimips/gio/newport.c      2006-10-08 17:32:18.000000000 +0200
@@ -690,10 +690,10 @@
                    control & ~VC2_CONTROL_CURSOR_ENABLE);
        } else {
                /* Work around bug in some board revisions */
-               if (dc->dc_boardrev < 6)
-                       x_offset = 21;
-               else if (dc->dc_vc2rev == 0)
+               if (dc->dc_vc2rev == 0)
                        x_offset = 29;
+               else if (dc->dc_boardrev < 6)
+                       x_offset = 21;
                else
                        x_offset = 31;