Subject: Re: X problem
To: Andreas Moschos <a_moschos@yahoo.com>
From: Michael <macallan18@earthlink.net>
List: port-macppc
Date: 12/07/2005 07:03:31
--Signature_Wed__7_Dec_2005_07_03_31_-0500_pm3Q1s_3VIT.5u/a
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: quoted-printable

Hello,

> This is the debugging info from the monolithic server:
>=20
> root@artemis:/tmp# gdb X
> This GDB was configured as "powerpc--netbsd"...(no
> debugging symbols found)...
> (gdb) run
> Starting program: /usr/X11R6/bin/X
> (no debugging symbols found)...(no debugging symbols
> found)...
> (no debugging symbols found)...(no debugging symbols
> found)...
> (=3D=3D) Using config file: "/etc/X11/XF86Config".
> xf86OpenConsole
> (no debugging symbols found)...(no debugging symbols
> found)...
> Program received signal SIGBUS, Bus error.
> 0x01885920 in stdReadCrtc ()
> (gdb) bt
> #0  0x01885920 in stdReadCrtc ()
> #1  0x01888dc4 in vgaHWUnlock ()
> #2  0x01821130 in R128Save ()
> #3  0x01820068 in R128ScreenInit ()
> #4  0x0198e5c0 in AddScreen ()
> #5  0x018fd51c in InitOutput ()
> #6  0x0198da60 in main ()
> #7  0x018031b0 in _start ()
> #8  0xefff3498 in ?? () from /usr/libexec/ld.elf_so
>=20
> looks like the bad guy is stdReadCrtc.

Argh. The Evil vgahw module. I should have known.

> Nothing more where reported by ktrace so i am not
> attaching anything.

ktrace is useless here, we're not looking at system calls.

> i hope this will help you.

Indeed it does.

So, please post the following things:
- dmesg output of the kernel you're currently running so we know what
  hardware we're talking about.
- pcictl dump output of the graphics chip.
- pcictl dump output of the PCI bridge that controls the bus the
  graphics chip sits on
- a complete XFree log

Background:
This driver apparently uses the vgahw module which is supposed to offer
halfway abstract access to legacy VGA registers. Since there reside in
PCI IO space they were inaccessible until very recently when I committed
a patch that allowed Xfree on macppc to mmap the IO space corresponding
to the graphics board it's using and that way access VGA registers.
Works well on my S900 with a Voodoo3.
You get a bus error if something violates alignment restrictions (
unlikely, the VGA registers are all 8bit as far as I remember ) or if
something tries to access PCI IO registers that aren't there, which
sounds more likely - that's what I think happened. I'm not sure you can
tell the R128 driver not to use vgahw ( but I'm pretty sure it's not
really necessary - both mach64 and radeon map all relevant registers
into memory space so the drivers work without IO access )
So we need to have a look what could possibly prevent the driver from
accessing the VGA registers. There are a few trivial things to check for
( IO space enabled at all, some PCI bridges need a bit set to allow
access to these registers and so on )

have fun
Michael

--Signature_Wed__7_Dec_2005_07_03_31_-0500_pm3Q1s_3VIT.5u/a
Content-Type: application/pgp-signature

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.0 (NetBSD)

iQEVAwUBQ5bPmMpnzkX8Yg2nAQLQDQgAtd/xjyX55UC6ZtE2jXbiFXjOUFPFuxcB
mJmIPRCF1ifkEL4VoWTeep0loMLnb/ChfnV+LbSRzCXG/j+tERtd8O4U95EHaygs
QvKdO4J5AFi9fxX81fav2i8F+YHkxccqEo/Z2aqF701slrvG5f/KRbWoZgZ3tknm
Fsxv7D1Nvj4VVbu8+kcF8enTLmriJigLGoWPhpyQa8JLa7uCUboVRRwVHjxuUWCJ
Kx3F58t7NIEE9QBHRBc3SRxAxUvZNDuSLxN8+6gtcY/JM3GVuMg2xm9ZVm+Z1pn4
yID3ushwjCkuP8spcK0L+1Qr4UmMfXl+cAJYaQWFDr1uVHiDHoQNXw==
=MlK+
-----END PGP SIGNATURE-----

--Signature_Wed__7_Dec_2005_07_03_31_-0500_pm3Q1s_3VIT.5u/a--