Subject: XFree86 on beige G3 - any hope?
To: None <port-macppc@netbsd.org>
From: Martijn van Buul <martijnb@stack.nl>
List: port-macppc
Date: 01/20/2002 14:24:38
Hello.

I'm using NetBSD 1.5.2 on my beige G3 (233, desktop), and having only
8bpp is starting to grow on my nerves - especially since private colour
maps seem to be not supported. I have been trying to get a recent
snapshot of XFree86 running (Which presumably has support for the
halfway broken Mach64 of the G3), but after toying with it for two
weeks, I think I must confess that it's growing over my head. The source
relies on "NetBSD" either being a M68K, Sparc or Intel on too many 
occasions, and some portions of the code seem to trip compiler errors.

I do have a stash of old video cards laying around, including a Matrox 
Millennium II, which is supported by the XFree86 package distributed
by NetBSD. Is it possible to use that card instead of the on-board
video? The problem is that it's a PC card. I tried flashing a MacOS
BIOS in, but the flasher recognizes the card as a Mystique 220 (Which
it isn't), and refushes to flash anything. I switched to serial console,
and tried running the X server. The furthest I got was XFree crashing
like this:

(--) MGA(0): Chipset: "mga2164w"
(II) MGA(0): Offscreen memory usage will be limited to 512 lines if the DRI is e
nabled.
(==) MGA(0): Using HW cursor
(**) MGA(0): Acceleration disabled
(--) MGA(0): Linear framebuffer at 0x84000000
(--) MGA(0): MMIO registers at 0x81804000
(--) MGA(0): Pseudo-DMA transfer window at 0x82000000
(--) MGA(0): BIOS at 0x81810000
xf86ReadBIOS() 81810000 0, 40
xf86ReadBIOS() 81810000 7ffc, 2
(--) MGA(0): Video BIOS info block at offset 0x0C07D
xf86ReadBIOS() 81810000 c07d, 40
(II) MGA(0): MGABios.RamdacType = 0x0
(II) MGA(0): mapVidMem 81804000, 4000, fd = 5

Fatal server error:
xf86MapVidMem: could not mmap screen [s=4000,a=81804000] (Invalid argument)

According to man mmap, mmap returns EINVAL when "MAP_FIXED was specified and
the addr parameter was not page aligned or was outside of the valid
address range for a process. MAP_ANON was specified and fd was not -1.
len was less than zero"

If I peek at the resource list earlier on, it clearly says in the 
"(II) resource ranges after probing:" section:

    [5] -1  0x81804000 - 0x81807fff (0x4000) MXB(B)

I assume that the driver uses MAP_FIXED for obvious reasons. MAP_ANON
doesn't make much sense. len is certainly bigger than 0. According to
getpagesize(), the PowerPC's pagesize is 0x1000 bytes, so 
0x81804000 sounds quite page aligned to me..

Any hints?

-- 
    Martijn van Buul -  Pino@dohd.org - http://www.stack.nl/~martijnb/
	 Geek code: G--  - Visit OuterSpace: mud.stack.nl 3333
   Kees J. Bot: The sum of CPU power and user brain power is a constant.