From owner-freebsd-x11@FreeBSD.ORG Thu Apr 16 16:34:05 2009 Return-Path: Delivered-To: freebsd-x11@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2D64F106570F for ; Thu, 16 Apr 2009 16:34:05 +0000 (UTC) (envelope-from lists@jnielsen.net) Received: from ns1.jnielsen.net (ns1.jnielsen.net [69.55.238.237]) by mx1.freebsd.org (Postfix) with ESMTP id EC4088FC2D for ; Thu, 16 Apr 2009 16:34:04 +0000 (UTC) (envelope-from lists@jnielsen.net) Received: from [192.168.213.128] (jn@stealth.jnielsen.net [74.218.226.254]) (authenticated bits=0) by ns1.jnielsen.net (8.12.9p2/8.12.9) with ESMTP id n3GGY2D1094191 for ; Thu, 16 Apr 2009 12:34:03 -0400 (EDT) (envelope-from lists@jnielsen.net) From: John Nielsen To: freebsd-x11@freebsd.org Date: Thu, 16 Apr 2009 12:34:01 -0400 User-Agent: KMail/1.9.10 References: <200904131902.22584.lists@jnielsen.net> <1239821670.2194.10.camel@balrog.2hip.net> <200904151529.06871.lists@jnielsen.net> In-Reply-To: <200904151529.06871.lists@jnielsen.net> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200904161234.02099.lists@jnielsen.net> X-Virus-Scanned: ClamAV version 0.88.4, clamav-milter version 0.88.4 on ns1.jnielsen.net X-Virus-Status: Clean Subject: Re: r128 dual-head error X-BeenThere: freebsd-x11@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: X11 on FreeBSD -- maintaining and support List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Apr 2009 16:34:05 -0000 On Wednesday 15 April 2009 03:29:06 pm John Nielsen wrote: > On Wednesday 15 April 2009, Robert Noland wrote: > > On Tue, 2009-04-14 at 22:12 -0400, John Nielsen wrote: > > > On Monday 13 April 2009, Warren Block wrote: > > > > On Mon, 13 Apr 2009, John Nielsen wrote: > > > > > From what I can tell I have my xorg.conf configured properly > > > > > and it's trying to do the right thing but it's throwing an > > > > > error when initializing the secondary screen: > > > > > > > > > > (EE) R128(1): Unable to map MMIO aperture. Invalid argument > > > > > (22) > > > I did some poor man's debugging of the original issue (by adding > > > some log print statements to the code). The function which is > > > throwing the "invalid argument" error is pci_device_map_range, > > > called from R128MapMMIO. With my > > > > This is in libpciaccess. 22 is EINVAL, the call may be failing on > > mtrr or just the attempt to remap the same register space a second > > time. The problem is either in libpciaccess or the r128 driver. > > Thanks. FWIW I did confirm that the space is un-mapped between the two > calls. I'll see if I can grok libpciaccess. So the above isn't 100% true. The sequence is: r128(0): map r128(0): unmap r128(1): map r128(1): unmap r128(0): map r128(1): map (fails) My previous (and false) assumption was that the two screens were trying to map _different_ regions for the MMIO. Since they share the same one, the sanity check in libpciaccess to make sure the same memory isn't mapped more than once fails and returns EINVAL. It looks like the previous regime (before libpciaccess) didn't have this sanity check. Removing the sanity check from libpciaccess allows the second screen to come up and it works fine, but that's more of a hack than a fix. The correct behavior would be to copy the MMIO pointer from the primary screen into the secondary screen's "info" structure rather than calling pci_device_map_range the final time. I'll see how long my ambition lasts and file a bug report (with Xorg) with whatever I end up with. Thanks, JN