Bug 21251 - fix r128 multi-head - patch included
Summary: fix r128 multi-head - patch included
Status: RESOLVED FIXED
Alias: None
Product: xorg
Classification: Unclassified
Component: Driver/rage128 (show other bugs)
Version: 7.4 (2008.09)
Hardware: x86 (IA32) FreeBSD
: medium normal
Assignee: Xorg Project Team
QA Contact: Xorg Project Team
URL:
Whiteboard:
Keywords: patch
Depends on:
Blocks:
 
Reported: 2009-04-17 09:21 UTC by John Nielsen
Modified: 2009-04-17 13:18 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments
Patch to correct the issue described (857 bytes, patch)
2009-04-17 09:21 UTC, John Nielsen
no flags Details | Splinter Review

Description John Nielsen 2009-04-17 09:21:47 UTC
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.
Comment 1 Alex Deucher 2009-04-17 13:12:07 UTC
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
Comment 2 Alex Deucher 2009-04-17 13:18:49 UTC
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.