From owner-freebsd-mobile@FreeBSD.ORG Wed Oct 10 23:27:00 2012 Return-Path: Delivered-To: freebsd-mobile@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 2EB49B5B; Wed, 10 Oct 2012 23:27:00 +0000 (UTC) (envelope-from nm.knife@gmail.com) Received: from mail-wi0-f178.google.com (mail-wi0-f178.google.com [209.85.212.178]) by mx1.freebsd.org (Postfix) with ESMTP id 7C9728FC0A; Wed, 10 Oct 2012 23:26:59 +0000 (UTC) Received: by mail-wi0-f178.google.com with SMTP id hr7so1186267wib.13 for ; Wed, 10 Oct 2012 16:26:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=85/NpFbyUs+rKj3FYdm8sKievcWhVkaJVEv7wsA5uuM=; b=LgT3T3B5JpDxTC5xnuaO/1f2VA+awYZ5l4vRsl61beCmMzeGm4c1W05oVljHL4V0Wh UAP1rvAz5Qy32lx6cpdAuTzNRItoHzI5hdwWE6aQz7bOV6szY1TuSpASOnPOj+Vo2Xe2 peY6VtED3RgOQwRQqAKDPyuQMu1FQYzFkkdRCBI7WAVCixLAyrfGK6z7ZITWWnMtl5Jh O3whkHKRQ/ePcGX6G7EW+W2d7JZScPpn0Up+wju0gJyKg6AgR3LArkim3N8YPLrs40nb 52sSeEUHGraBX3/a8Cgs7Pw8qIgKeTVtyhnszJpaD8ieSHaEBJK8SVxXou9giAEhbCzv TnZA== MIME-Version: 1.0 Received: by 10.216.195.133 with SMTP id p5mr15778222wen.1.1349911618291; Wed, 10 Oct 2012 16:26:58 -0700 (PDT) Received: by 10.227.38.145 with HTTP; Wed, 10 Oct 2012 16:26:58 -0700 (PDT) In-Reply-To: <20120814102409.7dc335b8@X220.ovitrap.com> References: <4E836C06.9070405@gmail.com> <4F7A46DB.4050701@gmail.com> <4F7A8A99.4040603@gmail.com> <20120403210619.Q2060@sola.nimnet.asn.au> <4F7DAAB0.2010206@gmail.com> <4F7E2D5C.3020506@gmail.com> <4F7F9504.1030405@gmail.com> <20120814102409.7dc335b8@X220.ovitrap.com> Date: Wed, 10 Oct 2012 16:26:58 -0700 Message-ID: Subject: Re: x220 notes From: =?windows-1251?B?y/7h7uzo8CDD8Ojj7vDu4g==?= To: Erich Dollansky Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.14 Cc: sendtomatt@gmail.com, freebsd-acpi@freebsd.org, freebsd-mobile@freebsd.org X-BeenThere: freebsd-mobile@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Mobile computing with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Oct 2012 23:27:00 -0000 Hi, I am now running 10 HEAD with latest committed KMS patch. I do not use currently suspend and resume on my X220. I use a script > for the brightness which makes it easy to handle for me. > I am still stuck with: - add LEN0086 to acpi_ibm - recompile - kldload acpi_call - acpi_call -p '\VBRC' -i n // n is 0-16 Can you share the script you have made, especially if you were able to bind hotkeys to it? > There is a fundamental problem with powerd which stops a notebook to > get better battery life time. powerd does not include the display > brightness and it does not inlcude user activities in its process to > regulate the CPU speed. In addition, the algorithm to find the best CPU > speed gets easily irritated with short bursts of peak performance > requirements. > > Erich > I do lose about 1-2 hours of battery time as opposed to Windows(I get 7-8 hours there) due to those same bursts of performance, despite running the adaptive profiles. My main concern is manual control of brightness though. -- Lyubomir Grigorov (bgalakazam) From owner-freebsd-mobile@FreeBSD.ORG Thu Oct 11 02:45:11 2012 Return-Path: Delivered-To: freebsd-mobile@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id BC1E7F46; Thu, 11 Oct 2012 02:45:11 +0000 (UTC) (envelope-from erichfreebsdlist@ovitrap.com) Received: from alogreentechnologies.com (alogreentechnologies.com [67.212.224.110]) by mx1.freebsd.org (Postfix) with ESMTP id 6A8608FC08; Thu, 11 Oct 2012 02:45:11 +0000 (UTC) Received: from X220.ovitrap.com ([122.129.201.2]) (authenticated bits=0) by alogreentechnologies.com (8.13.1/8.13.1) with ESMTP id q9B2ix4o017781; Wed, 10 Oct 2012 20:45:01 -0600 Date: Thu, 11 Oct 2012 09:44:59 +0700 From: Erich Dollansky To: =?UTF-8?B?0JvRjtCx0L7QvNC40YAg0JPRgNC40LPQvtGA0L7Qsg==?= Subject: Re: x220 notes Message-ID: <20121011094459.12ee1653@X220.ovitrap.com> In-Reply-To: References: <4E836C06.9070405@gmail.com> <4F7A46DB.4050701@gmail.com> <4F7A8A99.4040603@gmail.com> <20120403210619.Q2060@sola.nimnet.asn.au> <4F7DAAB0.2010206@gmail.com> <4F7E2D5C.3020506@gmail.com> <4F7F9504.1030405@gmail.com> <20120814102409.7dc335b8@X220.ovitrap.com> X-Mailer: Claws Mail 3.8.0 (GTK+ 2.24.6; amd64-portbld-freebsd10.0) Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Cc: sendtomatt@gmail.com, freebsd-acpi@freebsd.org, freebsd-mobile@freebsd.org X-BeenThere: freebsd-mobile@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Mobile computing with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Oct 2012 02:45:11 -0000 Hi, On Wed, 10 Oct 2012 16:26:58 -0700 =D0=9B=D1=8E=D0=B1=D0=BE=D0=BC=D0=B8=D1=80 =D0=93=D1=80=D0=B8=D0=B3=D0=BE= =D1=80=D0=BE=D0=B2 wrote: > Hi, I am now running 10 HEAD with latest committed KMS patch. I must admit that I did not update this machine since some time. >=20 > I do not use currently suspend and resume on my X220. I use a script > > for the brightness which makes it easy to handle for me. > > > I am still stuck with: > - add LEN0086 to acpi_ibm > - recompile > - kldload acpi_call > - acpi_call -p '\VBRC' -i n // n is 0-16 >=20 > Can you share the script you have made, especially if you were able > to bind hotkeys to it? >=20 The scripts are still available here http://www.alogreentechnologies.com/freebsd/XonX220 http://www.alogreentechnologies.com/freebsd/setbrightness I never tried to bind the script to keys. I made some menu items in blackbox which works for me. >=20 > > There is a fundamental problem with powerd which stops a notebook to > > get better battery life time. powerd does not include the display > > brightness and it does not inlcude user activities in its process to > > regulate the CPU speed. In addition, the algorithm to find the best > > CPU speed gets easily irritated with short bursts of peak > > performance requirements. > > > > Erich > > > I do lose about 1-2 hours of battery time as opposed to Windows(I get > 7-8 hours there) due to those same bursts of performance, despite > running the adaptive profiles. My main concern is manual control of > brightness though. >=20 You lose only 1-2h? I lose at least 2h. I have had several tries to make it better but got always held up by other things. My last attempts have still been with the Crusoe CPU. They gave the machine near XP battery times but needed manual interaction. So, I never published them. Erich From owner-freebsd-mobile@FreeBSD.ORG Fri Oct 12 02:55:00 2012 Return-Path: Delivered-To: freebsd-mobile@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 44A48BCC; Fri, 12 Oct 2012 02:55:00 +0000 (UTC) (envelope-from sendtomatt@gmail.com) Received: from mail-pa0-f54.google.com (mail-pa0-f54.google.com [209.85.220.54]) by mx1.freebsd.org (Postfix) with ESMTP id E50208FC0A; Fri, 12 Oct 2012 02:54:59 +0000 (UTC) Received: by mail-pa0-f54.google.com with SMTP id bi1so2586041pad.13 for ; Thu, 11 Oct 2012 19:54:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=vv9/W5x2M1EcS5lHxLpsn5K07IbbYRF76yb9PU9fP88=; b=P49xZWKa7SXIt0t8IVoFcYUbLUmiKeZdAWG8h4xh6dWDBBTEJQaMYNt5rehLcq02hb quQnVDe7elXYY3UT4yvRtUM+nYzm1T4d/9dLNFrW5k9IhYrjzb4fxHwPDEFejigDMKCv OfCZA4EzPRYm/oZVt9Zd44voCfJzcZViQXQJluTJBaQVQftpdHUC9VlstMW0hi0mGFIj idq5q6p4Nd/e2Wmi8Ur27Yr08U7SEAFiYC7Q0Wi4KDviQQFNKKGFJMKSQEFmtnVu/dO/ f3g85Psg23LB42lsiBHTSNSdYpTDnL3XhcvTVvSR/6oihOC2bivAxogC+TcuUcaIO0ed Z/Jw== Received: by 10.68.137.228 with SMTP id ql4mr9474962pbb.125.1350010499641; Thu, 11 Oct 2012 19:54:59 -0700 (PDT) Received: from flatline.local (70-36-223-239.dsl.dynamic.sonic.net. [70.36.223.239]) by mx.google.com with ESMTPS id oe5sm3674190pbb.8.2012.10.11.19.54.56 (version=SSLv3 cipher=OTHER); Thu, 11 Oct 2012 19:54:58 -0700 (PDT) Message-ID: <50778671.9020703@gmail.com> Date: Thu, 11 Oct 2012 19:54:41 -0700 From: matt User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:15.0) Gecko/20120912 Thunderbird/15.0.1 MIME-Version: 1.0 To: Erich Dollansky Subject: Re: x220 notes References: <4E836C06.9070405@gmail.com> <4F7A8A99.4040603@gmail.com> <20120403210619.Q2060@sola.nimnet.asn.au> <4F7DAAB0.2010206@gmail.com> <4F7E2D5C.3020506@gmail.com> <4F7F9504.1030405@gmail.com> <20120814102409.7dc335b8@X220.ovitrap.com> <20121011094459.12ee1653@X220.ovitrap.com> In-Reply-To: <20121011094459.12ee1653@X220.ovitrap.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Cc: freebsd-acpi@freebsd.org, =?UTF-8?B?0JvRjtCx0L7QvNC40YAg0JPRgNC40LPQvtGA0L7Qsg==?= , freebsd-mobile@freebsd.org X-BeenThere: freebsd-mobile@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Mobile computing with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Oct 2012 02:55:00 -0000 On 10/10/12 19:44, Erich Dollansky wrote: > Hi, > > On Wed, 10 Oct 2012 16:26:58 -0700 > Любомир Григоров wrote: > >> Hi, I am now running 10 HEAD with latest committed KMS patch. > I must admit that I did not update this machine since some time. >> I do not use currently suspend and resume on my X220. I use a script >>> for the brightness which makes it easy to handle for me. >>> >> I am still stuck with: >> - add LEN0086 to acpi_ibm >> - recompile >> - kldload acpi_call >> - acpi_call -p '\VBRC' -i n // n is 0-16 >> >> Can you share the script you have made, especially if you were able >> to bind hotkeys to it? >> > The scripts are still available here > > http://www.alogreentechnologies.com/freebsd/XonX220 > http://www.alogreentechnologies.com/freebsd/setbrightness > > I never tried to bind the script to keys. I made some menu items in > blackbox which works for me. >>> There is a fundamental problem with powerd which stops a notebook to >>> get better battery life time. powerd does not include the display >>> brightness and it does not inlcude user activities in its process to >>> regulate the CPU speed. In addition, the algorithm to find the best >>> CPU speed gets easily irritated with short bursts of peak >>> performance requirements. >>> >>> Erich >>> >> I do lose about 1-2 hours of battery time as opposed to Windows(I get >> 7-8 hours there) due to those same bursts of performance, despite >> running the adaptive profiles. My main concern is manual control of >> brightness though. >> > You lose only 1-2h? I lose at least 2h. > > I have had several tries to make it better but got always held up by > other things. > > My last attempts have still been with the Crusoe CPU. They gave the > machine near XP battery times but needed manual interaction. So, I > never published them. > > Erich > You've swapped the X220 cpu for something? Or a different machine? I find X does horrible things to battery usage on my X220. Getting into the lowest C state, and disabling ALL of the USB devices helps somewhat, as does setting a lower backlight level at boot (you can make an rc script, or catch the backlight buttons while the bios is still loading). Matt From owner-freebsd-mobile@FreeBSD.ORG Fri Oct 12 15:54:55 2012 Return-Path: Delivered-To: mobile@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 9CE08155; Fri, 12 Oct 2012 15:54:55 +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 59ADB8FC19; Fri, 12 Oct 2012 15:54:55 +0000 (UTC) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id B9861B98A; Fri, 12 Oct 2012 11:54:54 -0400 (EDT) From: John Baldwin To: freebsd-acpi@freebsd.org Subject: Re: Dell acpi_video patch Date: Fri, 12 Oct 2012 10:06:17 -0400 User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110714-p20; KDE/4.5.5; amd64; ; ) References: <20121005215316.GA38707@triton8.kn-bremen.de> In-Reply-To: <20121005215316.GA38707@triton8.kn-bremen.de> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201210121006.17276.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Fri, 12 Oct 2012 11:54:54 -0400 (EDT) Cc: acpi@freebsd.org, avilla@freebsd.org, Juergen Lock , mobile@freebsd.org X-BeenThere: freebsd-mobile@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Mobile computing with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Oct 2012 15:54:55 -0000 On Friday, October 05, 2012 5:53:16 pm Juergen Lock wrote: > Hi! > > I finally took a closer look why acpi_video found nothing on my > Dell laptop (Precision M4500), and came up with this patch: > > --- sys/dev/acpica/acpi_video.c.orig > +++ sys/dev/acpica/acpi_video.c > @@ -906,7 +906,7 @@ vid_enum_outputs_subr(ACPI_HANDLE handle > > for (i = 0; i < argset->dod_pkg->Package.Count; i++) { > if (acpi_PkgInt32(argset->dod_pkg, i, &val) == 0 && > - (val & DOD_DEVID_MASK_FULL) == adr) { > + (val & (DOD_DEVID_MASK_FULL | 0x80000000)) == adr) { > argset->callback(handle, val, argset->context); > argset->count++; > } > > which gives me: I think this is correct, but in we need to do more to properly handle that flag (DOD_DEVID_SCHEME_STD). Specifically, we shouldn't trust any bits in the device ID unless that bit is set (except for the special case of DOD_DEVID_LCD) as per my reading of the _DOD description in the ACPI 3.0b spec. I think this larger patch will do that while also fixing your case: Index: acpi_video.c =================================================================== --- acpi_video.c (revision 241382) +++ acpi_video.c (working copy) @@ -320,7 +320,8 @@ acpi_video_resume(device_t dev) ACPI_SERIAL_BEGIN(video_output); STAILQ_FOREACH_SAFE(vo, &sc->vid_outputs, vo_next, vn) { if ((vo->adr & DOD_DEVID_MASK_FULL) != DOD_DEVID_LCD && - (vo->adr & DOD_DEVID_MASK) != DOD_DEVID_INTDFP) + (vo->adr & (DOD_DEVID_SCHEME_STD | DOD_DEVID_MASK)) != + (DOD_DEVID_SCHEME_STD | DOD_DEVID_INTDFP)) continue; if ((vo_get_device_status(vo->handle) & DCS_ACTIVE) == 0) @@ -467,38 +468,40 @@ acpi_video_vo_init(UINT32 adr) ACPI_SERIAL_ASSERT(video); - switch (adr & DOD_DEVID_MASK) { + /* Assume an unknown unit by default. */ + desc = "unknown output"; + type = "out"; + voqh = &other_units; + + switch (adr & (DOD_DEVID_SCHEME_STD | DOD_DEVID_MASK)) { case DOD_DEVID_MONITOR: if ((adr & DOD_DEVID_MASK_FULL) == DOD_DEVID_LCD) { /* DOD_DEVID_LCD is a common, backward compatible ID */ desc = "Internal/Integrated Digital Flat Panel"; type = "lcd"; voqh = &lcd_units; - } else { - desc = "VGA CRT or VESA Compatible Analog Monitor"; - type = "crt"; - voqh = &crt_units; } break; - case DOD_DEVID_TV: + case DOD_DEVID_SCHEME_STD | DOD_DEVID_MONITOR: + desc = "VGA CRT or VESA Compatible Analog Monitor"; + type = "crt"; + voqh = &crt_units; + break; + case DOD_DEVID_SCHEME_STD | DOD_DEVID_TV: desc = "TV/HDTV or Analog-Video Monitor"; type = "tv"; voqh = &tv_units; break; - case DOD_DEVID_EXT: + case DOD_DEVID_SCHEME_STD | DOD_DEVID_EXT: desc = "External Digital Monitor"; type = "ext"; voqh = &ext_units; break; - case DOD_DEVID_INTDFP: + case DOD_DEVID_SCHEME_STD | DOD_DEVID_INTDFP: desc = "Internal/Integrated Digital Flat Panel"; type = "lcd"; voqh = &lcd_units; break; - default: - desc = "unknown output"; - type = "out"; - voqh = &other_units; } n = 0; @@ -633,21 +636,25 @@ acpi_video_vo_destroy(struct acpi_video_output *vo AcpiOsFree(vo->vo_levels); } - switch (vo->adr & DOD_DEVID_MASK) { + voqh = &other_units; + + switch (vo->adr & (DOD_DEVID_SCHEME_STD | DOD_DEVID_MASK)) { case DOD_DEVID_MONITOR: + if ((vo->adr & DOD_DEVID_MASK_FULL) == DOD_DEVID_LCD) + voqh = &lcd_units; + break; + case DOD_DEVID_SCHEME_STD | DOD_DEVID_MONITOR: voqh = &crt_units; break; - case DOD_DEVID_TV: + case DOD_DEVID_SCHEME_STD | DOD_DEVID_TV: voqh = &tv_units; break; - case DOD_DEVID_EXT: + case DOD_DEVID_SCHEME_STD | DOD_DEVID_EXT: voqh = &ext_units; break; - case DOD_DEVID_INTDFP: + case DOD_DEVID_SCHEME_STD | DOD_DEVID_INTDFP: voqh = &lcd_units; break; - default: - voqh = &other_units; } STAILQ_REMOVE(voqh, vo, acpi_video_output, vo_unit.next); free(vo, M_ACPIVIDEO); @@ -906,7 +913,8 @@ vid_enum_outputs_subr(ACPI_HANDLE handle, UINT32 l for (i = 0; i < argset->dod_pkg->Package.Count; i++) { if (acpi_PkgInt32(argset->dod_pkg, i, &val) == 0 && - (val & DOD_DEVID_MASK_FULL) == adr) { + (val & (DOD_DEVID_SCHEME_STD | DOD_DEVID_MASK_FULL)) == + adr) { argset->callback(handle, val, argset->context); argset->count++; } -- John Baldwin From owner-freebsd-mobile@FreeBSD.ORG Fri Oct 12 16:45:10 2012 Return-Path: Delivered-To: mobile@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 17E028EE; Fri, 12 Oct 2012 16:45:10 +0000 (UTC) (envelope-from nox@jelal.kn-bremen.de) Received: from smtp.kn-bremen.de (gelbbaer.kn-bremen.de [78.46.108.116]) by mx1.freebsd.org (Postfix) with ESMTP id E7ABF8FC18; Fri, 12 Oct 2012 16:45:08 +0000 (UTC) Received: by smtp.kn-bremen.de (Postfix, from userid 10) id A88DB1E000D3; Fri, 12 Oct 2012 18:35:35 +0200 (CEST) Received: from triton8.kn-bremen.de (noident@localhost [127.0.0.1]) by triton8.kn-bremen.de (8.14.4/8.14.4) with ESMTP id q9CGXnAx063624; Fri, 12 Oct 2012 18:33:49 +0200 (CEST) (envelope-from nox@triton8.kn-bremen.de) Received: (from nox@localhost) by triton8.kn-bremen.de (8.14.4/8.14.3/Submit) id q9CGXneX063623; Fri, 12 Oct 2012 18:33:49 +0200 (CEST) (envelope-from nox) From: Juergen Lock Date: Fri, 12 Oct 2012 18:33:49 +0200 To: John Baldwin Subject: Re: Dell acpi_video patch Message-ID: <20121012163349.GA63588@triton8.kn-bremen.de> References: <20121005215316.GA38707@triton8.kn-bremen.de> <201210121006.17276.jhb@freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201210121006.17276.jhb@freebsd.org> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: avilla@freebsd.org, freebsd-acpi@freebsd.org, Juergen Lock , mobile@freebsd.org X-BeenThere: freebsd-mobile@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Mobile computing with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Oct 2012 16:45:10 -0000 On Fri, Oct 12, 2012 at 10:06:17AM -0400, John Baldwin wrote: > On Friday, October 05, 2012 5:53:16 pm Juergen Lock wrote: > > Hi! > > > > I finally took a closer look why acpi_video found nothing on my > > Dell laptop (Precision M4500), and came up with this patch: > > > > --- sys/dev/acpica/acpi_video.c.orig > > +++ sys/dev/acpica/acpi_video.c > > @@ -906,7 +906,7 @@ vid_enum_outputs_subr(ACPI_HANDLE handle > > > > for (i = 0; i < argset->dod_pkg->Package.Count; i++) { > > if (acpi_PkgInt32(argset->dod_pkg, i, &val) == 0 && > > - (val & DOD_DEVID_MASK_FULL) == adr) { > > + (val & (DOD_DEVID_MASK_FULL | 0x80000000)) == adr) { > > argset->callback(handle, val, argset->context); > > argset->count++; > > } > > > > which gives me: > > I think this is correct, but in we need to do more to properly handle that > flag (DOD_DEVID_SCHEME_STD). Specifically, we shouldn't trust any bits in the > device ID unless that bit is set (except for the special case of > DOD_DEVID_LCD) as per my reading of the _DOD description in the ACPI 3.0b > spec. I think this larger patch will do that while also fixing your case: > > Index: acpi_video.c > =================================================================== > --- acpi_video.c (revision 241382) > +++ acpi_video.c (working copy) > @@ -320,7 +320,8 @@ acpi_video_resume(device_t dev) > ACPI_SERIAL_BEGIN(video_output); > STAILQ_FOREACH_SAFE(vo, &sc->vid_outputs, vo_next, vn) { > if ((vo->adr & DOD_DEVID_MASK_FULL) != DOD_DEVID_LCD && > - (vo->adr & DOD_DEVID_MASK) != DOD_DEVID_INTDFP) > + (vo->adr & (DOD_DEVID_SCHEME_STD | DOD_DEVID_MASK)) != > + (DOD_DEVID_SCHEME_STD | DOD_DEVID_INTDFP)) > continue; > > if ((vo_get_device_status(vo->handle) & DCS_ACTIVE) == 0) > @@ -467,38 +468,40 @@ acpi_video_vo_init(UINT32 adr) > > ACPI_SERIAL_ASSERT(video); > > - switch (adr & DOD_DEVID_MASK) { > + /* Assume an unknown unit by default. */ > + desc = "unknown output"; > + type = "out"; > + voqh = &other_units; > + > + switch (adr & (DOD_DEVID_SCHEME_STD | DOD_DEVID_MASK)) { > case DOD_DEVID_MONITOR: > if ((adr & DOD_DEVID_MASK_FULL) == DOD_DEVID_LCD) { > /* DOD_DEVID_LCD is a common, backward compatible ID */ > desc = "Internal/Integrated Digital Flat Panel"; > type = "lcd"; > voqh = &lcd_units; > - } else { > - desc = "VGA CRT or VESA Compatible Analog Monitor"; > - type = "crt"; > - voqh = &crt_units; > } > break; > - case DOD_DEVID_TV: > + case DOD_DEVID_SCHEME_STD | DOD_DEVID_MONITOR: > + desc = "VGA CRT or VESA Compatible Analog Monitor"; > + type = "crt"; > + voqh = &crt_units; > + break; > + case DOD_DEVID_SCHEME_STD | DOD_DEVID_TV: > desc = "TV/HDTV or Analog-Video Monitor"; > type = "tv"; > voqh = &tv_units; > break; > - case DOD_DEVID_EXT: > + case DOD_DEVID_SCHEME_STD | DOD_DEVID_EXT: > desc = "External Digital Monitor"; > type = "ext"; > voqh = &ext_units; > break; > - case DOD_DEVID_INTDFP: > + case DOD_DEVID_SCHEME_STD | DOD_DEVID_INTDFP: > desc = "Internal/Integrated Digital Flat Panel"; > type = "lcd"; > voqh = &lcd_units; > break; > - default: > - desc = "unknown output"; > - type = "out"; > - voqh = &other_units; > } > > n = 0; > @@ -633,21 +636,25 @@ acpi_video_vo_destroy(struct acpi_video_output *vo > AcpiOsFree(vo->vo_levels); > } > > - switch (vo->adr & DOD_DEVID_MASK) { > + voqh = &other_units; > + > + switch (vo->adr & (DOD_DEVID_SCHEME_STD | DOD_DEVID_MASK)) { > case DOD_DEVID_MONITOR: > + if ((vo->adr & DOD_DEVID_MASK_FULL) == DOD_DEVID_LCD) > + voqh = &lcd_units; > + break; > + case DOD_DEVID_SCHEME_STD | DOD_DEVID_MONITOR: > voqh = &crt_units; > break; > - case DOD_DEVID_TV: > + case DOD_DEVID_SCHEME_STD | DOD_DEVID_TV: > voqh = &tv_units; > break; > - case DOD_DEVID_EXT: > + case DOD_DEVID_SCHEME_STD | DOD_DEVID_EXT: > voqh = &ext_units; > break; > - case DOD_DEVID_INTDFP: > + case DOD_DEVID_SCHEME_STD | DOD_DEVID_INTDFP: > voqh = &lcd_units; > break; > - default: > - voqh = &other_units; > } > STAILQ_REMOVE(voqh, vo, acpi_video_output, vo_unit.next); > free(vo, M_ACPIVIDEO); > @@ -906,7 +913,8 @@ vid_enum_outputs_subr(ACPI_HANDLE handle, UINT32 l > > for (i = 0; i < argset->dod_pkg->Package.Count; i++) { > if (acpi_PkgInt32(argset->dod_pkg, i, &val) == 0 && > - (val & DOD_DEVID_MASK_FULL) == adr) { > + (val & (DOD_DEVID_SCHEME_STD | DOD_DEVID_MASK_FULL)) == > + adr) { > argset->callback(handle, val, argset->context); > argset->count++; > } > > -- > John Baldwin Thank you, yes that still works for me the same as my original patch: % sysctl hw.acpi.video. hw.acpi.video.crt0.active: 0 hw.acpi.video.lcd0.active: 0 hw.acpi.video.lcd0.brightness: 100 hw.acpi.video.lcd0.fullpower: 100 hw.acpi.video.lcd0.economy: 46 hw.acpi.video.lcd0.levels: 100 46 0 6 13 20 26 33 40 46 53 60 66 73 80 86 93 100 hw.acpi.video.ext0.active: 0 hw.acpi.video.ext1.active: 0 hw.acpi.video.ext2.active: 0 hw.acpi.video.ext3.active: 0 % Juergen From owner-freebsd-mobile@FreeBSD.ORG Fri Oct 12 23:58:06 2012 Return-Path: Delivered-To: mobile@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id B6038E43; Fri, 12 Oct 2012 23:58:06 +0000 (UTC) (envelope-from villa.alberto@gmail.com) Received: from mail-bk0-f54.google.com (mail-bk0-f54.google.com [209.85.214.54]) by mx1.freebsd.org (Postfix) with ESMTP id B1DD08FC12; Fri, 12 Oct 2012 23:58:05 +0000 (UTC) Received: by mail-bk0-f54.google.com with SMTP id jf20so1724961bkc.13 for ; Fri, 12 Oct 2012 16:58:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:cc:content-type; bh=Wo1xIGaulpteuNUG2BEJ82bPJHb0vq+ku6PcPQJBrfs=; b=bdcXqERnVIMUsxGHaB2xMKHeyJO0pyJLD6uJ8fHkcPB+eaF+AT5oH1UHZqVD8ulOgO WwVHx04I/nfEasltphiFDfIpuw4NvC87dWCmhlLj1Yq9+qyONtIbgvQuJr1OEOzEWum/ BxPvkF7bgXwr5sPofULc7bv03QQ+XHn3IlyaKzDjrnPz9Q2UsBfCQKhTrscHl7y5qyl6 4BC99BZNPqZ6YLdAyp7QFISuZP3S+DOtLPuxpjDBzHNtGZ9YEXWyMSuYryBY7WLLCduu aFkCktpD5LWrBBnSfe3PdxzQHU+ku9LbBGrKPwn9CIY+5exRybYdV6VrByR4rmItXWaG b3tA== Received: by 10.204.5.156 with SMTP id 28mr1659896bkv.86.1350086284481; Fri, 12 Oct 2012 16:58:04 -0700 (PDT) MIME-Version: 1.0 Sender: villa.alberto@gmail.com Received: by 10.204.227.144 with HTTP; Fri, 12 Oct 2012 16:57:43 -0700 (PDT) In-Reply-To: <201210121006.17276.jhb@freebsd.org> References: <20121005215316.GA38707@triton8.kn-bremen.de> <201210121006.17276.jhb@freebsd.org> From: Alberto Villa Date: Sat, 13 Oct 2012 01:57:43 +0200 X-Google-Sender-Auth: L3MEVWOp24tPaGFuZWV1xAl3ZG4 Message-ID: Subject: Re: Dell acpi_video patch To: John Baldwin Content-Type: text/plain; charset=ISO-8859-1 Cc: acpi@freebsd.org, freebsd-acpi@freebsd.org, Juergen Lock , mobile@freebsd.org X-BeenThere: freebsd-mobile@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Mobile computing with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Oct 2012 23:58:06 -0000 On Fri, Oct 12, 2012 at 4:06 PM, John Baldwin wrote: > I think this is correct, but in we need to do more to properly handle that > flag (DOD_DEVID_SCHEME_STD). Specifically, we shouldn't trust any bits in the > device ID unless that bit is set (except for the special case of > DOD_DEVID_LCD) as per my reading of the _DOD description in the ACPI 3.0b > spec. I think this larger patch will do that while also fixing your case: I tested your patch and the only effect is that my three reported screens (I'm on a laptop) changed from "crt" to "out" (I understand why, from the code): hw.acpi.video.out0.active: 1 hw.acpi.video.out1.active: 1 hw.acpi.video.out1.brightness: 100 hw.acpi.video.out1.fullpower: 100 hw.acpi.video.out1.economy: 50 hw.acpi.video.out1.levels: 100 50 0 10 20 30 40 50 60 70 80 90 100 hw.acpi.video.out2.active: 1 Is there something I can do to help you make them recognised correctly, or is it fault of a buggy ACPI table? -- Alberto Villa, FreeBSD committer http://people.FreeBSD.org/~avilla