From owner-freebsd-acpi@FreeBSD.ORG Fri Jul 1 07:12:57 2005 Return-Path: X-Original-To: freebsd-acpi@freebsd.org Delivered-To: freebsd-acpi@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 3B13616A41C for ; Fri, 1 Jul 2005 07:12:57 +0000 (GMT) (envelope-from kjelderg@gmail.com) Received: from rproxy.gmail.com (rproxy.gmail.com [64.233.170.202]) by mx1.FreeBSD.org (Postfix) with ESMTP id C6A6443D49 for ; Fri, 1 Jul 2005 07:12:56 +0000 (GMT) (envelope-from kjelderg@gmail.com) Received: by rproxy.gmail.com with SMTP id i8so219495rne for ; Fri, 01 Jul 2005 00:12:56 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:reply-to:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=CjgqqJX16FB8GgKNWJ2fsje1XEo7gITL04prZQhRtOgDoIz/0u71SzzsD5xvXL0mhGHytn2MEkcQEe7Xg3/hpxFJ9yeetL+NjJZigKiAV3ugyXNd3ip08ZPsvuJ1EiX8NNBk8ZgDklZHqAmYSdYlgBo0CJCUI15AzdsHUIg7cPo= Received: by 10.38.89.66 with SMTP id m66mr979548rnb; Fri, 01 Jul 2005 00:12:56 -0700 (PDT) Received: by 10.38.101.41 with HTTP; Fri, 1 Jul 2005 00:12:56 -0700 (PDT) Message-ID: Date: Fri, 1 Jul 2005 16:12:56 +0900 From: Eric Kjeldergaard To: Tobias Roth In-Reply-To: <20050630204357.GA24439@droopy.unibe.ch> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline References: <20050630120148.A67041@cons.org> <20050630204357.GA24439@droopy.unibe.ch> Cc: mobile@freebsd.org, freebsd-acpi@freebsd.org Subject: Re: ACPI Sleep on Thinkpad R40, wakeup fails for X11/radeon X-BeenThere: freebsd-acpi@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Eric Kjeldergaard List-Id: ACPI and power management development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 01 Jul 2005 07:12:57 -0000 On 7/1/05, Tobias Roth wrote: > On Thu, Jun 30, 2005 at 12:01:48PM -0400, Martin Cracauer wrote: > > Any ideas how I could fix suspend/resume on this Thinkpad? > >=20 > >=20 > > I have a Thinkpad R40 running 6.0-current. It has a Radeon 7500 with > > 32 MB. > >=20 > > When I suspend it with zzz (ACPI actice), the machine sleeps and wakes > > up fine except the X11 server is unhappy. > >=20 > > The X11 server has some graphical corruption, never updates graphics > > and does not take keyboard input (Control-Alt-F2 etc are also disabled > > and just beep). >=20 > please make sure that you don't have dri in your x.org / xfree config I guess this is a commonly known problem. In fact last October Bruce Simpson wrote: 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 ar= e 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=3Dl= inux-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 from attach into init functions and calling them on resume. Really going to sleep now. Regards, BMS I guess what I'd really like to know is is there any active work on this, any interest in getting this fixed, etc. I would very much like to see it fixed and would be fully willing to help out in any way I can. Hoping someone has information on this, Eric Kjeldergaard --=20 If I write a signature, my emails will appear more personalised.