Support for Lenovo acpi_video and nVidia GT740M Optimus video adaptor
O. Hartmann
ohartman at zedat.fu-berlin.de
Tue Sep 23 10:17:24 UTC 2014
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="GenuineIntel" Id=0x306c3 Family=0x6 Model=0x3c Stepping=3
Features=0xbfebfbff<FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CLFLUSH,DTS,ACPI,MMX,FXSR,SSE,SSE2,SS,HTT,TM,PBE>
Features2=0x7fdafbbf<SSE3,PCLMULQDQ,DTES64,MON,DS_CPL,VMX,EST,TM2,SSSE3,<b11>,FMA,CX16,xTPR,PDCM,PCID,SSE4.1,SSE4.2,MOVBE,POPCNT,TSCDLT,AESNI,XSAVE,OSXSAVE,AVX,F16C,RDRAND>
AMD Features=0x2c100800<SYSCALL,NX,Page1GB,RDTSCP,LM>
AMD Features2=0x21<LAHF,ABM>
Structured Extended Features=0x27ab<FSGSBASE,TSCADJ,BMI1,AVX2,SMEP,BMI2,ERMS,INVPCID>
XSAVE Features=0x1<XSAVEOPT>
VT-x: PAT,HLT,MTF,PAUSE,EPT,UG,VPID
TSC: P-state invariant, performance statistics
real memory = 9636413440 (9190 MB)
avail memory = 8149209088 (7771 MB)
Event timer "LAPIC" quality 600
ACPI APIC Table: <LENOVO TP-J9 >
[...]
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 fiunctionality as
expected. The laptop runs with 100% brightness of the LCD and consumes the battery very
quickly. Trying
#
# Display
#
hw.acpi.video.lcd0.fullpower=75
hw.acpi.video.lcd1.fullpower=75
hw.acpi.video.lcd0.econony=50
hw.acpi.video.lcd1.econony=50
hw.acpi.video.lcd0.brigthness=75
hw.acpi.video.lcd1.brigthness=75
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 provides doesn't
allow without operating system running the change of the brightness or muting the
speakers with FN + FXX key, as it is provided by many other EFI/UEFI firmwares.
iGPU/GPU/Optimus:
Another serious issue is the built-in video adaptor. In UEFI, I have the opportunity of
selecting either "integrated" or "nVidia Optimus". Selecting "integrated" is supposed to
utilize the built in iGPU HD4600 - which is since Haswell's dawn unsupported 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 with the
ability of sharing, what nVidia calls Optimus.
Starting X11 with any of the nVidia provided BLOBs (xf86-video-nv doesn't support modern
GPUs like that and FreeBSD doesn't have, in contrary to many Linux distributions, modern
xf86-video-nouveau: the driver is simply extinct from the ports) with 340.24, 340.32 and
343.13 gives a blank vt() console screen with a carrett in the uppermost lefthand corner.
Checking the the Xorg.log I realize, that the driver recognizes the existence of the GPU,
but it doesn't reveal any(!) display sockets, not even the built-in LCD. Whenever the
nvidia driver tries to access the video hardware, I see this messages popping 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: 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 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 0xfffff800044ef780),
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 at pci0:1:0:0: class=0x030200 card=0x502a17aa chip=0x129210de rev=0xa1 hdr=0x00
vendor = 'NVIDIA Corporation'
class = display
subclass = 3D
bar [10] = type Memory, range 32, base 0xf0000000, size 16777216, enabled
bar [14] = type Prefetchable Memory, range 64, base 0xc0000000, size 268435456,
enabled
bar [1c] = type Prefetchable Memory, range 64, base 0xd0000000, size 33554432,
enabled
bar [24] = 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:
dev.vgapci.0.%desc: VGA-compatible display
dev.vgapci.0.%driver: vgapci
dev.vgapci.0.%location: slot=0 function=0 handle=\_SB_.PCI0.PEG_.VID_
dev.vgapci.0.%pnpinfo: vendor=0x10de device=0x1292 subvendor=0x17aa subdevice=0x502a
class=0x030200 dev.vgapci.0.%parent: pci1
dev.vgapci.1.%desc: VGA-compatible display
dev.vgapci.1.%driver: vgapci
dev.vgapci.1.%location: slot=2 function=0 handle=\_SB_.PCI0.VID_
dev.vgapci.1.%pnpinfo: vendor=0x8086 device=0x0416 subvendor=0x17aa subdevice=0x502a
class=0x030000 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 disable explicitely
the nVidia GPU within the Optimus tandem, but none of the shown command sequences, which
could be applied via the ACPI module acpi_call, seems to work, due to obvious different
object identifiers.
I'd like to aske in this list whether there is a chance to have a switch and 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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 473 bytes
Desc: not available
URL: <http://lists.freebsd.org/pipermail/freebsd-acpi/attachments/20140923/f6a99f12/attachment.sig>
More information about the freebsd-acpi
mailing list