Subject: port-amiga/26788: X11 display trashed on Merlin (ite_et) gfx board
To: None <gnats-bugs@gnats.NetBSD.org>
From: None <pch@po.opole.pl>
List: netbsd-bugs
Date: 08/28/2004 16:12:24
>Number:         26788
>Category:       port-amiga
>Synopsis:       X11 display trashed on Merlin (ite_et) gfx board
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    port-amiga-maintainer
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sat Aug 28 16:13:00 UTC 2004
>Closed-Date:
>Last-Modified:
>Originator:     Pawel Chwalowski
>Release:        1.6.2
>Organization:
>Environment:
NetBSD zbytniczka 1.6.2 NetBSD 1.6.2 (ZBYTNICZKA) #0: Wed Jun 23 03:23:12 UTC 2004
pch@zbytniczka:/usr/src/sys/arch/amiga/compile/ZBYTNICZKA amiga 
>Description:
I just started X11 via startx, opened xterm, inserted a cd-rom in a drive
and mounted it as root. Screen was trashed... xterms fonts was unreadable,
moving windows causes more garbage on the screen.
X11 display is trashed as a result of a message sent to the console.
"ite driver dont't touch any registers, and just stuff appropriate data into memory".
It was described before in:
http://mail-index.netbsd.org/port-amiga/1999/06/0001.html
It was fixed a few years ago in ite_cl driver. The ite_et driver (based on cl) was not fixed.

>How-To-Repeat:
It is appear when you not use xconsole (or xterm -C) to catch messages.
>Fix:
--- /sys/arch/amiga/dev/ite_et.c    Mon Jan 28 10:57:00 2002
+++ /home/pch/src/sys/arch/amiga/dev/ite_et.c   Sat Aug 28 11:24:45 2004
@@ -159,6 +159,9 @@
    unsigned char attr;
    unsigned char *cp;
 
+   if (ip->flags & ITE_INGRF)
+       return;
+
    attr =(unsigned char) ((mode & ATTR_INV) ? (0x70) : (0x07));
    if (mode & ATTR_UL)     attr  = 0x01;   /* ???????? */
    if (mode & ATTR_BOLD)   attr |= 0x08;
@@ -183,6 +186,9 @@
    volatile unsigned char *ba = ip->grf->g_regkva;
    int len;
 
+   if (ip->flags & ITE_INGRF)
+       return;
+
    dst = ip->grf->g_fbkva + (sy * ip->cols) + sx;
    src = dst + (ip->rows*ip->cols);
    len = w*h;
@@ -199,6 +205,9 @@
 {
    unsigned char *fb;
    volatile unsigned char *ba = ip->grf->g_regkva;
+
+   if (ip->flags & ITE_INGRF)
+       return;
 
    fb = ip->grf->g_fbkva + sy * ip->cols;
    SetTextPlane(ba, 0x00);
 

>Release-Note:
>Audit-Trail:
>Unformatted: