Configure X & graphics for Lenovo Yoga 3 14

tl;dr

  1. The Intel driver should work just fine.
  2. It is still possible to control brightness.

Background information

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:


Using the Intel card

Using the Intel driver

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:

  1. Install graphics/drm-next-kmod.

  2. Add kld_list="/boot/modules/i915kms.ko" to /etc/rc.conf.

Backlight

Using the VESA driver

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

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

References


Using the Nvidia card

Here's what I've tried.

  1. Install x11/nvidia-driver.

  2. 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/.

  3. Add the following to /etc/rc.conf:

    kld_list="i915kms drmn nvidia-modeset"
    hald_enable="YES"
    dbus_enable="YES"
    linux_enable="YES"
  4. 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:

but nothing worked.

From what I read, the nvidia driver is supporting this card. I've got no idea what went wrong.

References

Troubleshooting


CategoryLaptop CategoryLenovo

Laptops/Lenovo_Yoga_3_14/X (last edited 2018-04-21T16:53:34+0000 by MateuszPiotrowski)