Configure X & graphics for Lenovo Yoga 3 14
- The Intel driver should work just fine.
- It is still possible to control brightness.
Lenovo Yoga 3 14 has 2 graphic cards natively: Nvidia GeForce 940M and Intel HD Graphics 5500 (Broadwell). Here's the output of pciconf -lv | grep display -B 3 -A 1:
vgapci0@pci0:0:2:0: class=0x030000 card=0x391717aa chip=0x16168086 rev=0x09 hdr=0x00 vendor = 'Intel Corporation' device = 'HD Graphics 5500' class = display subclass = VGA -- vgapci1@pci0:3:0:0: class=0x030200 card=0x391717aa chip=0x134710de rev=0xa2 hdr=0x00 vendor = 'NVIDIA Corporation' device = 'GM108M [GeForce 940M]' class = display subclass = 3D
I tested the X server with the dwm window manager. Here are the steps to set it up:
echo exec dwm > ~/.xinitrc
Now test the X server executing by startx
Using the Intel card
Using the Intel driver
It is now supported as of FreeBSD 12.0-CURRENT r323983. (Brightness control finally works!)
I'm using the latest FreeBSD 12.0-CURRENT r323983. It works on FreeBSD 11-STABLE. Remember to update your kernel, userland and ports before following the steps below:
Add kld_list="/boot/modules/i915kms.ko" to /etc/rc.conf.
Backlight could be controlled using intel-backlight.
The brightness control keys work if you load the acpi_video(4) kernel module. They are too precise however (it takes too long to make a significant brightness change using those keys).
For some reason xbacklight does not work:
$ xbacklight No outputs have backlight property
Using the VESA driver
Really slow and laggy.
I ran X -configure (which is not recommended by the handbook) and copied the resulting file over to /usr/local/etc/X11/. Then I deleted the other non-VESA device from the file.
I guess that the following configuration is sufficient for X to run using VESA (put those into some xorg.conf):
Section "Device" Identifier "Card0" Driver "vesa" BusID "PCI:0:2:0" EndSection
Using the SCFB driver
It works but it doesn't support some features like brightness control.
VESA is slow and I could get Nvidia to work, so before some recent changes to the kernel (as of more or less FreeBSD 12.0-CURRENT r323983: Mon Sep 25 08:04:12 CEST 2017) I used the SCFB driver for a while. Now it is not necessary as the support for the Intel driver is already available in FreeBSD 12.0-CURRENT and probably in FreeBSD 11.1-RELEASE (at least that's what the graphics/drm-next-kmod port requires).
Add this to xorg.conf and make sure there are no other files configuring X:
Section "Device" Identifier "Card0" Driver "scfb" BusID "PCI:0:2:0" EndSection
UEFI Xorg (EE) no screens found on FreeBSD 11.0-RELEASE: https://lists.freebsd.org/pipermail/freebsd-stable/2017-January/086560.html
System Console Frame Buffer (SCFB): Graphics/SCFB
Using the Nvidia card
Black screen with a white cursor in the upper left corner (broken and unusable).
Here's what I've tried.
Make sure to delete /etc/X11/xorg.conf, /usr/local/etc/X11/xorg.conf and any files in /usr/local/etc/X11/xorg.conf.d/.
Add the following to /etc/rc.conf:
kld_list="i915kms drmn nvidia-modeset" hald_enable="YES" dbus_enable="YES" linux_enable="YES"
Add the following to /usr/local/etc/X11/xorg.conf.d/10-nvidia.conf
Section "Device" Identifier "NVIDIA Card" VendorName "NVIDIA Corporation" Driver "nvidia" BusID "PCI:3:0:0" EndSection
As a result I got:
[ 242.977] (EE) No devices detected. [ 242.977] (EE) Fatal server error: [ 242.977] (EE) no screens found(EE) [ 242.977] (EE) Please consult the The X.Org Foundation support at http://wiki.x.org for help. [ 242.978] (EE) Please also check the log file at "/var/log/Xorg.0.log" for additional information. [ 242.978] (EE) [ 242.985] (EE) Server terminated with error (1). Closing log file.
I've tried to solve it with:
X -configure and some additional tweaking the xorg.conf file;
both nvidia-xconfig and nvidia-xconfig --enable-all-gpus;
but nothing worked.
From what I read, the nvidia driver is supporting this card. I've got no idea what went wrong.