From owner-freebsd-current@FreeBSD.ORG Sun Oct 10 03:02:23 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 A25CB16A4CE; Sun, 10 Oct 2004 03:02:23 +0000 (GMT) Received: from www.cryptography.com (li-22.members.linode.com [64.5.53.22]) by mx1.FreeBSD.org (Postfix) with ESMTP id 6029143D2D; Sun, 10 Oct 2004 03:02:23 +0000 (GMT) (envelope-from nate@root.org) Received: from [10.0.5.51] (adsl-64-171-187-209.dsl.snfc21.pacbell.net [64.171.187.209]) by www.cryptography.com (8.12.8/8.12.8) with ESMTP id i9A32J1d030001 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Sat, 9 Oct 2004 20:02:20 -0700 Message-ID: <4168A637.7060708@root.org> Date: Sat, 09 Oct 2004 20:02:15 -0700 From: Nate Lawson User-Agent: Mozilla Thunderbird 0.7.3 (Windows/20040803) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Bruce M Simpson References: <5ad23a300410071928791fa9c@mail.gmail.com> <20041008030317.GV664@empiric.icir.org> <5ad23a3004100720467646e1ea@mail.gmail.com> <20041008102758.GH718@empiric.icir.org> <20041008223600.GL718@empiric.icir.org> In-Reply-To: <20041008223600.GL718@empiric.icir.org> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit cc: anholt@freebsd.org cc: freebsd-current@freebsd.org cc: imp@freebsd.org cc: Jordan Sissel Subject: Re: Radeon AGP suspend/resume support 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: Sun, 10 Oct 2004 03:02:23 -0000 Bruce M Simpson wrote: > On Fri, Oct 08, 2004 at 03:27:58AM -0700, Bruce M Simpson wrote: > >>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 > > Actually the problem is worse than that, from what I can see. There is a > module in the xorg/Xfree86 tree called bsd_apm.c. This is meant to poll > the /dev/apm device on the BSDs for suspend/resume event notifications > coming from the APM BIOS. > > There are two problems with this: > 1) This uses a NetBSD specific interface, which, whilst broadly similar > to FreeBSD's apm support, is not ABI compatible with ours. I've made a patch for this (attached) that uses a set of compat defines. > 2) The ACPI apm shim does not dispatch such events. They are only > dispatched within the system if 'real' BIOS APM support is in the > kernel. This cannot co-exist with ACPI. Furthermore they are only > announced on the /dev/apmctl device; there are some comments in the > code to this effect. Since the comments claim NetBSD dispatches these on /dev/apmctl but the bsd_apm.c code only uses /dev/apm, either NetBSD doesn't actually work or it also dispatches the events to /dev/apm. > So *no* suspend/resume support ever actually gets called, for any userland > driver in the X tree, on FreeBSD. It seems X needs to be re-educated about > how FreeBSD suspends and resumes. It may well be more appropriate to rewrite > this module entirely from scratch for use with ACPI. I forgot to mention before, this isn't actually true. We call the VTY switch code in user mode to switch to a tty before suspending and switch back to X on resume. This has the same effect as a suspend/resume in most cases since the driver needs to restore the video mode. I agree that it's better though to explicitly work with X's suspend/resume support. Can Eric or someone more familiar with X comment on how bsd_apm.c and the like is actually used in practice? I'm not sure which events X actually uses, whether it needs to block, etc. -- Nate