From owner-freebsd-acpi@FreeBSD.ORG Mon Feb 25 21:13:24 2013 Return-Path: Delivered-To: freebsd-acpi@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 8AFC8F48; Mon, 25 Feb 2013 21:13:24 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (bigknife-pt.tunnel.tserv9.chi1.ipv6.he.net [IPv6:2001:470:1f10:75::2]) by mx1.freebsd.org (Postfix) with ESMTP id 69995854; Mon, 25 Feb 2013 21:13:24 +0000 (UTC) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 93BDEB93B; Mon, 25 Feb 2013 16:13:22 -0500 (EST) From: John Baldwin To: freebsd-acpi@freebsd.org Subject: Re: Fixing X220 Video The Right Way Date: Mon, 25 Feb 2013 13:30:56 -0500 User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110714-p25; KDE/4.5.5; amd64; ; ) References: <512A6FFF.2060603@gmail.com> In-Reply-To: <512A6FFF.2060603@gmail.com> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201302251330.57034.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Mon, 25 Feb 2013 16:13:22 -0500 (EST) Cc: freebsd-current@freebsd.org X-BeenThere: freebsd-acpi@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: ACPI and power management development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Feb 2013 21:13:24 -0000 On Sunday, February 24, 2013 2:54:39 pm matt wrote: > I am working on fixing acpi_video for X220. > > My X220 is back to FreeBSD land, and I always felt \VBRC calls were dirty. > So I've set out to fix acpi_video to work naturally, as it does in linux > land. > > Background: > Lenovo laptops boot in a mode where the brightness keys automagically > work, under BIOS/EC control. > This gets blown away (for us) shortly after Kernel attach. > > At this point, the acpi method \NBCF will return 0, which means acpi > cannot control video brightness. > > Once we touch the _BCL method on the video output (even inactive ones), > \NBCF returns 1 and will allow acpi control. > > You may remember that acpi_video records some brightness value that > changes with keypresses, but does not work on X220. > > Current status: > If I modify acpi video to attach to \_SB.PCI0.PEG.VID, brightness works > via sysctl but not keypress (\NBCF = 1) > > If I leave that alone, but just redirect the brightness set function to > \_SB.PCI0.PEG.VID.LCD0._BCM, the keyboard works > > That is obviously a hack, but it indicates something is going on here. > > I think that get_acpi_handle() on the X220 vgapci is returning the wrong > ACPI_HANDLE. > Perhaps this is why the screen stays off when resume used to work? > > Obviously it can be fixed by hard coding this path into acpi_video, but > I feel like that is definitely the wrong way. > A tunable for an acpi_video override might be useful, but it still > leaves potentially the wrong path in vgapci's IVARs. > > Is there a better place to "correct" the ACPI_PATH that gets stored in > vgapci's ivar? Is there already a tunable I can use to fix this? vgapci's ivar is set by the PCI address. Do you have multiple vgapci devices? -- John Baldwin