From owner-freebsd-current@FreeBSD.ORG Fri Oct 8 10:28:07 2004 Return-Path: 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 7BF4716A4CE; Fri, 8 Oct 2004 10:28:07 +0000 (GMT) Received: from arginine.spc.org (arginine.spc.org [195.206.69.236]) by mx1.FreeBSD.org (Postfix) with ESMTP id E698743D3F; Fri, 8 Oct 2004 10:28:06 +0000 (GMT) (envelope-from bms@spc.org) Received: from localhost (localhost [127.0.0.1]) by arginine.spc.org (Postfix) with ESMTP id E79F2653E8; Fri, 8 Oct 2004 11:28:05 +0100 (BST) Received: from arginine.spc.org ([127.0.0.1]) by localhost (arginine.spc.org [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 32391-01; Fri, 8 Oct 2004 11:28:04 +0100 (BST) Received: from empiric.dek.spc.org (adsl-67-121-92-60.dsl.snfc21.pacbell.net [67.121.92.60]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by arginine.spc.org (Postfix) with ESMTP id D6156653E6; Fri, 8 Oct 2004 11:28:03 +0100 (BST) Received: by empiric.dek.spc.org (Postfix, from userid 1001) id DACB7616C; Fri, 8 Oct 2004 03:27:58 -0700 (PDT) Date: Fri, 8 Oct 2004 03:27:58 -0700 From: Bruce M Simpson To: Jordan Sissel Message-ID: <20041008102758.GH718@empiric.icir.org> Mail-Followup-To: Jordan Sissel , freebsd-current@freebsd.org, anholt@FreeBSD.org References: <5ad23a300410071928791fa9c@mail.gmail.com> <20041008030317.GV664@empiric.icir.org> <5ad23a3004100720467646e1ea@mail.gmail.com> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="DozTQjXnjm3C9Xhk" Content-Disposition: inline In-Reply-To: <5ad23a3004100720467646e1ea@mail.gmail.com> cc: anholt@FreeBSD.org cc: freebsd-current@freebsd.org Subject: Radeon AGP suspend/resume support (was: Re: Thinkpad T41 Sleep issues) X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 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, 08 Oct 2004 10:28:07 -0000 --DozTQjXnjm3C9Xhk Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hello, On Thu, Oct 07, 2004 at 11:46:19PM -0400, Jordan Sissel wrote: > Absolutely, I'll help in any way I can. I'm currently content without > drm, however I would like to see it fixed for those who can't stop > playing crack attack (me!). I presently have zero knowlwedge about > kernel modules or drm, but I'm willing to learn and help with > whatever's going on with this. What this boils down to is that we have some of the pieces to do it, but not all of them. Those who are interested in the technical specifics (written up herein so as to benefit from mailing list archiving) may wish to read on. Ok. Well some initial research suggests that many of the userland pieces are already there in xorg 6.7.0, after some rummaging around in the source: http://www.spinics.net/lists/xf-xpert/msg04368.html And most of what we need in the DRM driver is already there, and is presumably called by the DRI framework in the X server: http://www.freebsd.org/cgi/cvsweb.cgi/src/sys/dev/drm/radeon_cp.c (Revision 1.7 in particular) What I'm not clear about is if the device gets cleanly stopped before FreeBSD actually suspends the machine (with acpi or without). I think Eric may be able to help clarify some of this as he's more familiar with the code in question than I (Cc:'d). One of the things the original author of the Radeon resume patch raised was that it needed the AGP GART driver to reinitialize correctly after a resume, and submitted an additional patch for Linux. From the failure modes of this combination I've observed in the past, it amounts to: 2D graphics work fine after an ACPI resume, but 3D graphics no longer work. The patch in question for Linux is here: http://cpbotha.net/files/dri_reinit/agpgart-i845-resume.patch http://www.ussg.iu.edu/hypermail/linux/kernel/0408.1/0089.html http://fxr.watson.org/fxr/source/drivers/char/agp/intel-agp.c?v=3Dlinux-2.= 6.1#L1427 The Radeon chip sits on the AGP bus, which hangs off a Host-to-AGP bridge (a PCI function in the northbridge of the chipset). Whilst AGP looks like PCI in terms of hardware configuration, it is quite different. The T41 uses the Odem chipset; this in turn uses the agp_intel.c driver. Observe: agp0@pci0:0:0: class=3D0x060000 card=3D0x05291014 chip=3D0x33408086 rev=3D= 0x03 hdr=3D0x00 vendor =3D 'Intel Corporation' device =3D '82855PM Odem Host-Hub Interface Bridge' class =3D bridge subclass =3D HOST-PCI pcib1@pci0:1:0: class=3D0x060400 card=3D0x00000000 chip=3D0x33418086 rev=3D= 0x03 hdr=3D0x01 vendor =3D 'Intel Corporation' device =3D '82855PM Odem AGP Bridge' class =3D bridge subclass =3D PCI-PCI The PCI bus code was recently updated to save the configuration space of all PCI child devices on a suspend/resume. This however does *not* apply to bridge devices, because they're totally different in their operation to child devices. We don't currently implement suspend/resume support for agp. I suspect this is on several people's TODO or WISHLISTS judging from previous list traffic. I suspect this is where the problem lies. My main machine is an IBM T40, which has near identical hardware, so I will try to hack on this when I can. This could be as simple as refactoring some of the code in agp_intel.c =66rom attach into init functions and calling them on resume. Really going to sleep now. Regards, BMS --DozTQjXnjm3C9Xhk Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Comment: '' iD8DBQFBZmuuueUpAYYNtTsRAqHKAJ9bESLCkhIE4QcwBvnoirmwigH5EgCfZNLT LJSrwqo8cJwrEGMhlvic0PM= =gh5z -----END PGP SIGNATURE----- --DozTQjXnjm3C9Xhk--