From owner-freebsd-current@FreeBSD.ORG Fri Dec 16 20:22:04 2005 Return-Path: X-Original-To: freebsd-current@freebsd.org Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 95AEA16A41F for ; Fri, 16 Dec 2005 20:22:04 +0000 (GMT) (envelope-from jhb@freebsd.org) Received: from speedfactory.net (mail6.speedfactory.net [66.23.216.219]) by mx1.FreeBSD.org (Postfix) with ESMTP id D50D743D69 for ; Fri, 16 Dec 2005 20:21:44 +0000 (GMT) (envelope-from jhb@freebsd.org) Received: from server.baldwin.cx (unverified [66.23.211.162]) by speedfactory.net (SurgeMail 3.5b3) with ESMTP id 3961078 for multiple; Fri, 16 Dec 2005 15:19:41 -0500 Received: from localhost (john@localhost [127.0.0.1]) by server.baldwin.cx (8.13.1/8.13.1) with ESMTP id jBGKLav1081921; Fri, 16 Dec 2005 15:21:36 -0500 (EST) (envelope-from jhb@freebsd.org) From: John Baldwin To: Anish Mistry Date: Fri, 16 Dec 2005 15:22:03 -0500 User-Agent: KMail/1.8.2 References: <200512141720.01572.jhb@freebsd.org> <200512151631.26253.jhb@freebsd.org> <200512152133.28401.mistry.7@osu.edu> In-Reply-To: <200512152133.28401.mistry.7@osu.edu> MIME-Version: 1.0 Content-Type: Multipart/Mixed; boundary="Boundary-00=_sHyoDEs6QsjsMkO" Message-Id: <200512161522.04051.jhb@freebsd.org> X-Virus-Scanned: ClamAV 0.87.1/1210/Thu Dec 15 10:23:22 2005 on server.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-2.8 required=4.2 tests=ALL_TRUSTED autolearn=failed version=3.0.2 X-Spam-Checker-Version: SpamAssassin 3.0.2 (2004-11-16) on server.baldwin.cx X-Server: High Performance Mail Server - http://surgemail.com r=1653887525 Cc: freebsd-current@freebsd.org Subject: Re: hostb(4) and vgapci(4) patch X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Dec 2005 20:22:04 -0000 --Boundary-00=_sHyoDEs6QsjsMkO Content-Type: text/plain; charset="iso-8859-6" Content-Transfer-Encoding: 7bit Content-Disposition: inline On Thursday 15 December 2005 09:33 pm, Anish Mistry wrote: > On Thursday 15 December 2005 04:31 pm, you wrote: > > On Thursday 15 December 2005 12:32 am, Anish Mistry wrote: > > > On Wednesday 14 December 2005 05:20 pm, John Baldwin wrote: > > > > I have a patch that is an attempt to untangle a few things in > > > > relation to Host-PCI bridges and VGA PCI devices. Basically, > > > > the change is to create a more "real" hostb driver as well as a > > > > new vgapci driver and to change agp, drm, and acpi_video to > > > > attach to these drivers. This means among other things: > > > > > > > > - In theory you can now kldload agp after boot since it still > > > > has a place to attach to. > > > > - i830/915 drm is no longer a child of agp, instead both become > > > > children of vgapci0. > > > > - You can now use acpi_video with drm as both attach as > > > > children of vgapci0. - This provides a way for us to possibly > > > > solve the DPMS problem for suspend/resume (including a cleaner > > > > way to do the hack dpms patch I posted to acpi@ a long while > > > > ago that several people still use). > > > > > > > > Some other details include: > > > > > > > > - agp devices no longer map the _entire_ aperture into > > > > contiguous KVA meaning that it might be possible now to use a > > > > 256 MB aperture without panicing - I've added a new pci_if.m > > > > method for locating a specific capability for a PCI device. > > > > > > > > I have tested this on my laptop and verified that dri still > > > > works, but it needs some wider testing, especially the > > > > i830/i915 case is slightly more complicated. Also, this is not > > > > going to work with the nvidia-driver currently, but that's > > > > something that can be fixed in the future. If the agp > > > > non-mapping does fix the 256 MB aperture issues then I will > > > > probably MFC that part to RELENG_6. > > > > > > > > http://www.FreeBSD.org/~jhb/patches/agp_cvs.patch > > > > > > Thank you! It seems to work as advertised. I'm running mach64 > > > DRM with the DPMS patch acpi_video and they both work. :) > > > One small problem though. When I unload the acpi_video module > > > and reload it I get the following: > > > littleguy# kldload acpi_video > > > acpi_video0: on vgapci0 > > > acpi_video1: on vgapci0 > > > littleguy# kldunload acpi_video > > > acpi_video0: detached > > > acpi_video1: detached > > > littleguy# kldunload acpi_video > > > kldunload: can't find file acpi_video: No such file or directory > > > littleguy# kldload acpi_video > > > acpi_video0: on vgapci0 > > > acpi_video1: on vgapci0 > > > acpi_video2: on vgapci0 > > > littleguy# > > > It also created multiple sysctls with subsequent loads: > > > hw.acpi.video.crt0.active: 1 > > > hw.acpi.video.lcd0.active: 1 > > > hw.acpi.video.tv0.active: 0 > > > hw.acpi.video.crt1.active: 1 > > > hw.acpi.video.lcd1.active: 1 > > > hw.acpi.video.tv1.active: 0 > > > hw.acpi.video.crt2.active: 1 > > > hw.acpi.video.lcd2.active: 1 > > > hw.acpi.video.tv2.active: 0 > > > > Revert just the changes to acpi_video.c and then apply the attached > > patch to see if it fixes the multiple load issue. > > Yes. The patch corrects the problem. Actually, can you try a simpler one just to be sure? Thanks. -- John Baldwin <>< http://www.FreeBSD.org/~jhb/ "Power Users Use the Power to Serve" = http://www.FreeBSD.org --Boundary-00=_sHyoDEs6QsjsMkO Content-Type: text/x-diff; charset="iso-8859-6"; name="agp_acpi.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="agp_acpi.patch" --- //depot/vendor/freebsd/src/sys/dev/acpica/acpi_video.c 2005/09/11 18:40:38 +++ //depot/user/jhb/agp/dev/acpica/acpi_video.c 2005/12/16 16:42:11 @@ -70,6 +70,7 @@ /* interfaces */ static int acpi_video_modevent(struct module*, int, void *); +static void acpi_video_identify(driver_t *driver, device_t parent); static int acpi_video_probe(device_t); static int acpi_video_attach(device_t); static int acpi_video_detach(device_t); @@ -137,6 +138,7 @@ #define DSS_COMMIT (1 << 31) static device_method_t acpi_video_methods[] = { + DEVMETHOD(device_identify, acpi_video_identify), DEVMETHOD(device_probe, acpi_video_probe), DEVMETHOD(device_attach, acpi_video_attach), DEVMETHOD(device_detach, acpi_video_detach), @@ -152,7 +154,7 @@ static devclass_t acpi_video_devclass; -DRIVER_MODULE(acpi_video, pci, acpi_video_driver, acpi_video_devclass, +DRIVER_MODULE(acpi_video, vgapci, acpi_video_driver, acpi_video_devclass, acpi_video_modevent, NULL); MODULE_DEPEND(acpi_video, acpi, 1, 1, 1); @@ -189,6 +191,14 @@ return (err); } +static void +acpi_video_identify(driver_t *driver, device_t parent) +{ + + if (device_find_child(parent, "acpi_video", -1) == NULL) + device_add_child(parent, "acpi_video", -1); +} + static int acpi_video_probe(device_t dev) { --Boundary-00=_sHyoDEs6QsjsMkO--