From owner-freebsd-acpi@FreeBSD.ORG Tue Sep 23 10:17:24 2014 Return-Path: Delivered-To: freebsd-acpi@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A8741829 for ; Tue, 23 Sep 2014 10:17:24 +0000 (UTC) Received: from outpost1.zedat.fu-berlin.de (outpost1.zedat.fu-berlin.de [130.133.4.66]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 37408F8 for ; Tue, 23 Sep 2014 10:17:24 +0000 (UTC) Received: from inpost2.zedat.fu-berlin.de ([130.133.4.69]) by outpost.zedat.fu-berlin.de (Exim 4.82) for freebsd-acpi@FreeBSD.org with esmtp (envelope-from ) id <1XWN9n-0021RD-W3>; Tue, 23 Sep 2014 12:17:16 +0200 Received: from e179169208.adsl.alicedsl.de ([85.179.169.208] helo=hermann.walstatt.dynvpn.de) by inpost2.zedat.fu-berlin.de (Exim 4.82) for freebsd-acpi@FreeBSD.org with esmtpsa (envelope-from ) id <1XWN9n-002eoc-S4>; Tue, 23 Sep 2014 12:17:15 +0200 Date: Tue, 23 Sep 2014 12:16:36 +0200 From: "O. Hartmann" To: "freebsd-acpi@FreeBSD.org" Subject: Support for Lenovo acpi_video and nVidia GT740M Optimus video adaptor Message-ID: <20140923121636.6e4021db.ohartman@zedat.fu-berlin.de> Organization: FU Berlin X-Mailer: Claws Mail 3.10.1 (GTK+ 2.24.22; amd64-portbld-freebsd11.0) MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; boundary="Sig_/PqX=oLGYNrJN6sFmc1swdyl"; protocol="application/pgp-signature" X-Originating-IP: 85.179.169.208 X-ZEDAT-Hint: A X-BeenThere: freebsd-acpi@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: ACPI and power management development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Sep 2014 10:17:24 -0000 --Sig_/PqX=oLGYNrJN6sFmc1swdyl Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable I have a Lenovo ThinkPad E540 which has the following CPU: FreeBSD clang version 3.4.1 (tags/RELEASE_34/dot1-final 208032) 20140512 VT: running with driver "efifb". info: [drm] Initialized drm 1.1.0 20060810 CPU: Intel(R) Core(TM) i5-4200M CPU @ 2.50GHz (2494.28-MHz K8-class CPU) Origin=3D"GenuineIntel" Id=3D0x306c3 Family=3D0x6 Model=3D0x3c Steppi= ng=3D3 Features=3D0xbfebfbff Features2=3D0x7fdafbbf,FMA,CX16,xTPR,PDCM,PCID,SSE4.1,SSE4.2,MOVBE,POPCNT,TSCDLT,AESNI,XSAV= E,OSXSAVE,AVX,F16C,RDRAND> AMD Features=3D0x2c100800 AMD Features2=3D0x21 Structured Extended Features=3D0x27ab XSAVE Features=3D0x1 VT-x: PAT,HLT,MTF,PAUSE,EPT,UG,VPID TSC: P-state invariant, performance statistics real memory =3D 9636413440 (9190 MB) avail memory =3D 8149209088 (7771 MB) Event timer "LAPIC" quality 600 ACPI APIC Table: [...] This laptop has a integrated HD4600 iGPU (Haswell CPU) as well as a nVidia = GT 740M GPU, which is supposed to be with Optimus technology. I will refer to this issue= later in this post. ACPI_VIDEO/ACPI_IBM: loading both of these ACPI kernel modules seem not to provide any fiunction= ality as expected. The laptop runs with 100% brightness of the LCD and consumes the = battery very quickly. Trying=20 # # Display # hw.acpi.video.lcd0.fullpower=3D75 hw.acpi.video.lcd1.fullpower=3D75 hw.acpi.video.lcd0.econony=3D50 hw.acpi.video.lcd1.econony=3D50 hw.acpi.video.lcd0.brigthness=3D75 hw.acpi.video.lcd1.brigthness=3D75 in /etc/sysctl remains without effect. I presume this is due to the laptop = is neither supported by the acpi_ibm.ko nor acpi_video.ko modules either? Is there a way to manipulate the LCD brightnes? The Firmware Lenovo provide= s doesn't allow without operating system running the change of the brightness or muti= ng the speakers with FN + FXX key, as it is provided by many other EFI/UEFI firmwa= res. iGPU/GPU/Optimus: Another serious issue is the built-in video adaptor. In UEFI, I have the op= portunity of selecting either "integrated" or "nVidia Optimus". Selecting "integrated" i= s supposed to utilize the built in iGPU HD4600 - which is since Haswell's dawn unsupporte= d in FreeBSD. So, for some reasons along with my work, I'd like to have the dedicated GPU= anyway, the nVidia GT 740M. And here is the culprit. First, I do not know whether this device is a hybrid or real discrete GPU w= ith the ability of sharing, what nVidia calls Optimus. Starting X11 with any of the nVidia provided BLOBs (xf86-video-nv doesn't s= upport modern GPUs like that and FreeBSD doesn't have, in contrary to many Linux distribu= tions, modern xf86-video-nouveau: the driver is simply extinct from the ports) with 340.2= 4, 340.32 and 343.13 gives a blank vt() console screen with a carrett in the uppermost le= fthand corner. Checking the the Xorg.log I realize, that the driver recognizes the existen= ce of the GPU, but it doesn't reveal any(!) display sockets, not even the built-in LCD. Wh= enever the nvidia driver tries to access the video hardware, I see this messages poppi= ng up on the console, indicating that there is something wrong, I presume: [...] Sep 21 09:38:30 hermann kernel: ACPI Warning: \_SB_.PCI0.PEG_.VID_._DSM: Ar= gument #4 type mismatch - Found [Buffer], ACPI requires [Package] (20130823/nsarguments-97= ) Sep 21 09:38:30 hermann kernel: ACPI Warning: \_SB_.PCI0.PEG_.VID_._DSM: Argument = #4 type mismatch - Found [Buffer], ACPI requires [Package] (20130823/nsarguments-97= ) Sep 21 09:38:30 hermann kernel: ACPI Warning: \_SB_.PCI0.PEG_.VID_._DSM: Argument = #4 type mismatch - Found [Buffer], ACPI requires [Package] (20130823/nsarguments-97= ) Sep 21 09:38:30 hermann kernel: ACPI Warning: \_SB_.PCI0.PEG_.VID_._DSM: Argument = #4 type mismatch - Found [Buffer], ACPI requires [Package] (20130823/nsarguments-97= ) Sep 21 09:38:30 hermann kernel: ACPI Warning: \_SB_.PCI0.PEG_.VID_._DSM: Argument = #4 type mismatch - Found [Buffer], ACPI requires [Package] (20130823/nsarguments-97= ) Sep 21 09:38:30 hermann kernel: ACPI Warning: \_SB_.PCI0.PEG_.VID_._DSM: Argument = #4 type mismatch - Found [Buffer], ACPI requires [Package] (20130823/nsarguments-97= ) Sep 21 09:38:30 hermann kernel: ACPI Warning: \_SB_.PCI0.PEG_.VID_._DSM: Argument = #4 type mismatch - Found [Buffer], ACPI requires [Package] (20130823/nsarguments-97= ) Sep 21 09:38:30 hermann kernel: ACPI Warning: \_SB_.PCI0.PEG_.VID_._DSM: Argument = #4 type mismatch - Found [Buffer], ACPI requires [Package] (20130823/nsarguments-97= ) Sep 21 09:38:30 hermann kernel: ACPI Error: Field [TBF3] at 270336 exceeds Buffer = [NULL] size 262144 (bits) (20130823/dsopcode-249) Sep 21 09:38:30 hermann kernel: ACPI = Error: Method parse/execution failed [\_SB_.PCI0.PEG_.VID_.GETB] (Node 0xfffff800044ef740= ), AE_AML_BUFFER_LIMIT (20130823/psparse-553) Sep 21 09:38:30 hermann kernel: = ACPI Error: Method parse/execution failed [\_SB_.PCI0.PEG_.VID_._ROM] (Node 0xfffff8000= 44ef780), AE_AML_BUFFER_LIMIT (20130823/psparse-553) Sep 21 09:38:30 hermann kernel: = ACPI Warning: \_SB_.PCI0.PEG_.VID_._DSM: Argument #4 type mismatch - Found [Buffer], ACPI= requires [Package] (20130823/nsarguments-97) [...] Checking the existence of VGA devices via pciconf, I receive this: vgapci0@pci0:1:0:0: class=3D0x030200 card=3D0x502a17aa chip=3D0x129210d= e rev=3D0xa1 hdr=3D0x00 vendor =3D 'NVIDIA Corporation' class =3D display subclass =3D 3D bar [10] =3D type Memory, range 32, base 0xf0000000, size 16777216, e= nabled bar [14] =3D type Prefetchable Memory, range 64, base 0xc0000000, siz= e 268435456, enabled bar [1c] =3D type Prefetchable Memory, range 64, base 0xd0000000, siz= e 33554432, enabled bar [24] =3D type I/O Port, range 32, base 0x5000, size 128, enabled and looking for VGA devices in the ACPI OID range, I find those: dev.vgapci.%parent:=20 dev.vgapci.0.%desc: VGA-compatible display dev.vgapci.0.%driver: vgapci dev.vgapci.0.%location: slot=3D0 function=3D0 handle=3D\_SB_.PCI0.PEG_.VID_ dev.vgapci.0.%pnpinfo: vendor=3D0x10de device=3D0x1292 subvendor=3D0x17aa s= ubdevice=3D0x502a class=3D0x030200 dev.vgapci.0.%parent: pci1 dev.vgapci.1.%desc: VGA-compatible display dev.vgapci.1.%driver: vgapci dev.vgapci.1.%location: slot=3D2 function=3D0 handle=3D\_SB_.PCI0.VID_ dev.vgapci.1.%pnpinfo: vendor=3D0x8086 device=3D0x0416 subvendor=3D0x17aa s= ubdevice=3D0x502a class=3D0x030000 dev.vgapci.1.%parent: pci0 dev.acpi_video.0.%parent: vgapci0 dev.acpi_video.1.%parent: vgapci1 dev.nvidia.0.%parent: vgapci0 Two VGA devices which has as their parents the other one? I found several Howtos written for Linux specific cases to enable or disabl= e explicitely the nVidia GPU within the Optimus tandem, but none of the shown command seq= uences, which could be applied via the ACPI module acpi_call, seems to work, due to obvio= us different object identifiers. I'd like to aske in this list whether there is a chance to have a switch an= d how it might be used. I can provide the ACPI dump, if requested. If there is anything I can provide further, please ask. Thanks in advance, Oliver --Sig_/PqX=oLGYNrJN6sFmc1swdyl Content-Type: application/pgp-signature; name=signature.asc Content-Disposition: attachment; filename=signature.asc -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQEcBAEBAgAGBQJUIUiKAAoJEOgBcD7A/5N8bqIIAMI59a2dt+lx9gfUgzKNjPKG +bluDB/T0frN250xRTCtXDQGM6X3KF9YgjZH/3bmvS63FF4IHK+KD//lD493Y7jp kkv42Bisg4wpRkBWjfOnKR2yhDyrHMCLRkw2tEGicW3QUuBMGNClMFUAHUcOXEHX nw4nzugJj+EmymvCrECuKqzuXyW8TPsNEuOg1pXw9cLwTPzGeX6IHLKnEKdPt/o3 9JUACHZ3Z8NGPp4w3W8x5q3hMwTPPxPWrIPsd7g5vJyuiCATk1rT6phnUZ2XuDa9 2DOape13QO3EVJ7I+xne2K9oFty+YIi/DP5yKWcXduQ9sh1VJKPy9QeOc6whkno= =iBPC -----END PGP SIGNATURE----- --Sig_/PqX=oLGYNrJN6sFmc1swdyl--