Created attachment 24902 [details] [review] Patch to correct the issue described Multi-head in r128-6.8.0 does not work on my (admittedly old) laptop, a Dell Inspiron 4000 with "ATI Technologies Inc Rage Mobility M3 AGP 2x rev 2" graphics. If using a config with a single Screen section everything works as expected. I'm trying to use a Xinerama config file with two Screen sections. ScreenInit for the first head completes, but then the server dies with this when initializing the secondary head: (EE) R128(1): Unable to map MMIO aperture. Invalid argument (22) Fatal server error: AddScreen/ScreenInit failed for driver 1 With some help from Robert Noland via the freebsd-x11 mailing list I was able to track this down to a libpciaccess sanity check failing. The driver uses (and tries to map) the same MMIO region for both screens. During the initialization of the second screen libpciaccess sees that it is already mapped and throws EINVAL. My guess is that this worked prior to the libpciaccess re-work and not enough people are running ancient laptops to have tested it much since then. I am attaching a patch which adds a check in R128MapMMIO() to see if a) this is a secondary screen and b) the primary screen already has a valid MMIO pointer. If either check fails the MMIO region is mapped as before. Otherwise the pointer is simply copied from the primary screen. The patch fixes the issue on my aforementioned laptop. I don't have other Mobility M2/M3 hardware to test with but I expect that the same fix is needed for all systems using the driver. From reading through the driver I see that there is only one PCI device entity regardless of the number of screens defined, and the driver has to manually divide the video RAM between the screens if there are two. So I think it's safe to assume that there is only a single MMIO region for any device supported by the driver.
This looks good to me. BTW, I ported r128 to radeon and added randr 1.2 support a while back, but never finished dri support. if you are interested, the code is here: http://cgit.freedesktop.org/~agd5f/xf86-video-ati/?h=r128-support
pushed: 771c707eb2bba21b6013327bb62859c37be08673 Thanks!
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.