Subject: Re: X on IP22 success
To: Christopher SEKIYA <wileyc@rezrov.net>
From: Ilpo Ruotsalainen <lonewolf@iki.fi>
List: port-sgimips
Date: 01/22/2004 15:53:38
--pf9I7BMVVzbSWLtt
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

On Thu Jan 22 2004 at 22:24:05 +0900, Christopher SEKIYA wrote:
> It looks like only the high eight bits are used in the colormap (i.e.,
> at 24bpp, things look okay until you try to use something that exceeds
> 256 colors, and at 8bpp you're stuck in monochrome).

The X driver isn't very thorough in setting up things on the newport, it
assumes some things are already set up "right" for it. Since the kernel
driver does very explicit setup especially on the XMAPs, it might switch
some things to a "non-ARCS-default" mode which the X driver doesn't
like.

> > This is wrong (I suppose the wrongness is in checking board rev and not
> > VC2 rev), my rev 1 board needs x_offset == 21 for correct results.
> 
> I think none of us have rev1 boards.  My dmesg shows rev1 for the wscons
> driver probe, but rev6 for the X probe.  The wscons newport driver definitely
> does not get the board rev correctly.

"Oops."

Can you try the attached patch, see if it gets the rev right?

> This needs to become an offset relative to the newport register base, as you
> said, which makes the nasty IP22/IP24 hack in the X driver go away.
> 
> (linux uses absolute addresses?!?)

The driver on linux just mmaps /dev/mem on the absolute address, yup.
There's hardly any interaction between kernel drivers and X on linux...

> > I think we'd need to map this uncached too?
> 
> Dunno, actually.  Things look okay with it mapped as cached addresses
> so far ...

Yah, but I *think* the X driver could lose some of the gfifo drains if
we were using uncached access - not sure though. (I think some of the
gfifo waits are just plain redundant in *any* case, but as the spec is
rather unclear on this I'd just let them be for now.)

-- 
Ilpo Ruotsalainen - <lonewolf@iki.fi> - http://www.iki.fi/lonewolf/

--pf9I7BMVVzbSWLtt
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename="newport-revision-bug.patch"

Index: newport.c
===================================================================
RCS file: /cvsroot/src/sys/arch/sgimips/gio/newport.c,v
retrieving revision 1.1
diff --unified -r1.1 newport.c
--- newport.c	15 Dec 2003 05:24:51 -0000	1.1
+++ newport.c	22 Jan 2004 13:49:14 -0000
@@ -487,7 +487,7 @@
 	    (1 << REX3_DCBMODE_CSHOLD_SHIFT) |
 	    (1 << REX3_DCBMODE_CSSETUP_SHIFT));
 
-	dc->dc_boardrev = (rex3_read(dc, REX3_REG_DCBDATA0) >> 4) & 0x07;
+	dc->dc_boardrev = ((rex3_read(dc, REX3_REG_DCBDATA0) >> 24) >> 4) & 0x07;
 
 	/* Setup cursor glyph */
 	curp = vc2_read_ireg(dc, VC2_IREG_CURSOR_ENTRY);

--pf9I7BMVVzbSWLtt--