From owner-freebsd-current@FreeBSD.ORG Thu Feb 28 05:15:57 2013 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id C6D2D3E5; Thu, 28 Feb 2013 05:15:57 +0000 (UTC) (envelope-from sendtomatt@gmail.com) Received: from mail-pb0-f54.google.com (mail-pb0-f54.google.com [209.85.160.54]) by mx1.freebsd.org (Postfix) with ESMTP id 63DE9ABD; Thu, 28 Feb 2013 05:15:57 +0000 (UTC) Received: by mail-pb0-f54.google.com with SMTP id rr4so839152pbb.41 for ; Wed, 27 Feb 2013 21:15:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:message-id:date:from:user-agent:mime-version:to:cc :subject:references:in-reply-to:content-type :content-transfer-encoding; bh=vcHuXRbQzGqGK8WDMgXub26s45yCbS+b6a1SmNNamD8=; b=XVe1qAQvhuaIfpxcgGymfCZu4oUT9r/cJop6TK3UkpGgyBfHZGEmBSuNQunnt2SLme up52l26YPt53+cDqXTRopEZZXrO5dNvbFh1FKjZI1wBq91PTB/t+7Llrki4oBUVyEIXD zKbgDVn5+8ow8pF8P61ewt+xsx5zq3nLZGRsfqUyzyw4SM1g8lVhTT2Owjc/jhVOhnmJ bGVQTvyiEoOEdRorA5Iv67fQ7hZCawGMRCjdIcXYThbtEtBJiP/qEVm8YhOBKyr9qHCg FXraDhjCd5UkQgnvMvtTmY8osqp494xXSMq1r5GU43+pBktR1wQf0muhBs4P8ZkcVuqY lePg== X-Received: by 10.66.88.164 with SMTP id bh4mr11397218pab.41.1362028551377; Wed, 27 Feb 2013 21:15:51 -0800 (PST) Received: from ghost.local (70-36-223-239.dsl.dynamic.sonic.net. [70.36.223.239]) by mx.google.com with ESMTPS id bi8sm7849292pab.15.2013.02.27.21.15.49 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 27 Feb 2013 21:15:50 -0800 (PST) Message-ID: <512F5882.7080004@gmail.com> Date: Thu, 28 Feb 2013 05:15:46 -0800 From: matt User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:17.0) Gecko/20130228 Thunderbird/17.0.3 MIME-Version: 1.0 To: John Baldwin Subject: Re: Fixing X220 Video The Right Way References: <512A6FFF.2060603@gmail.com> <201302271200.22976.jhb@freebsd.org> <512E51FF.5010701@gmail.com> <201302271527.37079.jhb@freebsd.org> In-Reply-To: <201302271527.37079.jhb@freebsd.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: Adrian Chadd , freebsd-current@freebsd.org, freebsd-acpi@freebsd.org X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.14 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: Thu, 28 Feb 2013 05:15:57 -0000 On 02/27/13 12:27, John Baldwin wrote: > On Wednesday, February 27, 2013 1:35:43 pm matt wrote: >> On 02/27/13 09:00, John Baldwin wrote: >>> If that is true, it's because your BIOS is lying. Do you have a URL to >>> your ASL lying around already? >> Too big for pastebin :( +500k >> >> https://docs.google.com/file/d/0B6YlMzJxarGbVnotLUdNWWNTVG8/edit?usp=sharing > Here is where I find _DOD and _DOS methods: > > Device (PCI0) > Device (VID) > Name (_ADR, 0x00020000) // _ADR: Address > Method (_DOS, 1, NotSerialized) // _DOS: Disable Output Switching > Method (_DOD, 0, NotSerialized) // _DOD: Display Output Devices > Device (PEG) > Name (_ADR, 0x00010000) // _ADR: Address > Device (VID) > Name (_ADR, 0x00) // _ADR: Address > Method (_DOS, 1, NotSerialized) // _DOS: Disable Output Switching > Method (_DOD, 0, NotSerialized) // _DOD: Display Output Devices > > PCI0.VID is a PCI device at pci0:0:2:0. > PCI0.PEG would be a PCI-PCI bridge at pci0:0:1:0. > It would have a child device at 0:0 that would be PCI0.PEG.VID. Does the X220 > have a switchable GPU (e.g. it has built-in Intel graphics, but also has an > Nvidia GPU or some such?). If so, I imagine that PCI0.VID is the Intel graphics > and PEG is the non-Intel. The output of 'pciconf -lcv' would be useful to determine > that. If both PCI devices exist you shoudl have both acpi_video0 and acpi_video1. > However, it may be that the acpi_video driver doesn't cope well with having multiple > devices. Only Intel graphics, there is no option for switchable graphics. I initially thought that PEG was for Optimus usage, and left in the bios by accident (i.e. Lenovo using a generic DSDT for many machines) Here is pciconf -lcf, truncated hostb0@pci0:0:0:0: class=0x060000 card=0x21da17aa chip=0x01048086 rev=0x09 hdr=0x00 vendor = 'Intel Corporation' device = '2nd Generation Core Processor Family DRAM Controller' class = bridge subclass = HOST-PCI cap 09[e0] = vendor (length 12) Intel cap 0 version 1 vgapci0@pci0:0:2:0: class=0x030000 card=0x21da17aa chip=0x01268086 rev=0x09 hdr=0x00 vendor = 'Intel Corporation' device = '2nd Generation Core Processor Family Integrated Graphics Controller' class = display subclass = VGA cap 05[90] = MSI supports 1 message enabled with 1 message cap 01[d0] = powerspec 2 supports D0 D3 current D0 cap 13[a4] = PCI Advanced Features: FLR TP none0@pci0:0:22:0: class=0x078000 card=0x21da17aa chip=0x1c3a8086 rev=0x04 hdr=0x00 vendor = 'Intel Corporation' As you can see there is no device at pci0:0:1:0. So no dev_t with for acpi_video to probe or attach to. Nonetheless, only PEGs ACPI methods work, which is quite broken. This is true for a large number of Lenovo devices, back to x61 (non-attaching AGP adr) and probably including some other x series and t series. Unfortunately the ASL will not compile which makes fixing the DSDT an exercise in fixing broken ACPI. What I find interesting is that as far as I can tell, there's no special case handling for this device in Linux, yet backlight controls work out of the box since about 3.0. Installing Linux as the OSI via loader.conf is not the issue, unfortunately, nor Windows 2006 (/WVIS) or Windows 2009 (/WIN7). I get correct (for platform) behavior when I call PEGs _BCM... :( Is Linux getting this to work by doing it wrong, essentially? Matt