Lenovo ThinkPad P52

As of 2018-09-30 this is a WIP page inspired by Lenovo ThinkPad P50. Feel free to chat with me (zougloub on freenode) if you're figuring stuff out or have questions.

Peculiarities

 * (EDIT): The system doesn't boot from the Gentoo Install or Gentoo Admin USB Key (converted from ISO as there's not optical drive included). In order to get this working you need to boot from another distribution
 * (EDIT): The system boots with Hybrid Graphics Mode, but doesn't work correctly. You can't run startx or run lspci. it will cause the system to hang when using SystemRescueCD (tested version 6.0.20). To solve this you need to edit the grub configuration before booting and append the following 2 items: acpi_osi=! acpi_osi="Windows 2009" and press F10 to boot. After Hybrid Graphics mode boots fine
 * (EDIT): startx doesnt't work when booting as described below. As a temporary solution is to run rmmod nouveau and create an /etc/X11/xorg.conf on the USB key and specify the Intel lines described in the corresponding section below. After xorg will start just fine.
 * Touchpad isn't working out of the box (as of 2018-09-30)
 * Hybrid graphics are not a breeze to use

Power management
This section deals with:


 * Tips for reducing power consumption
 * Suspend/resume

TODO see Lenovo_ThinkPad_P50

Graphics
The laptop has an integrated Intel GPU (iGPU) and a second NVIDIA GPU (dGPU).

External displays are routed through the dGPU, and the laptop screen is connected to the iGPU.

The knobs to configure the displays are:


 * The BIOS: it can either enable hybrid graphics or only the dGPU
 * The bbswitch module (part of Bumblebee) can enable/disable the dGPU in a hybrid graphics configuration
 * Bumblebee can route OpenGL / OpenCL calls to the dGPU
 * The PRIME "thing" handles display routing through one or the other GPU
 * Using the nouveau or NVIDIA proprietary drivers

Obviously:


 * If external displays are to be used, the dGPU must be on
 * The iGPU takes less power (see Power Management)
 * The ideal configuration is hybrid graphics, with all display connectors available, and rendering mainly done using the iGPU, with the dGPU helping out for graphics-intensive loads and when external displays are to be used.

Notable configurations that work:


 * 1) BIOS in discrete graphics with NVIDIA-only display (that's the easiest way)
 * 2) BIOS in hybrid graphics with Intel-only display and Bumblebee, no external displays (everything is good except for no external displays)
 * 3) BIOS in hybrid graphics with laptop panel on iGPU and xf86-video-intel (not modesetting) and external displays using eGPU and NVIDIA proprietary drivers, which will be detailed hereafter.

As of 2018-12-21, a recipe to have the latter configuration working is:

Setup

 * 1) Install NVIDIA proprietary drivers
 * 2) Install  and
 * 3) Edit Bumblebee's  as follows (important bits are   and  ):
 * 4) Add an  snippet as follows (to use the   driver, which offers ):
 * 5) Set  to have   and , which allows to keep the display active after running a dummy

Usage

 * 1) Run  to start the Bumblebee X server
 * 2) Run  which will plug the NVIDIA hardware outputs as virtual outputs on the current X screen
 * 3) At this point the plugged external monitors will become available in XRandR, as virtual devices, e.g.

Thunderbolt
Use  or.

DisplayPort outputs are simply routed graphics, i.e. their working depends on the GPU configuration...

SD card reader
Handled by the  kernel module.

Touchpad
In order to have the trackpoint/touchpad work:


 * Ensure the  module has been built with elantech options
 * Pass  to the   kernel module (either by kernel command-line or modprobe.d configuration file)

Touchscreen
In order to have the touchscreen work:


 * Multi-touch is handled by the  kernel module
 * Multi-touch at the X/Wayland level is handled by the  X module (not  !).

Notes:


 * will show a non-empty list of event if the touchscreen is configured properly:


 * will show finger ids when configured properly:


 * :3[examples]'s gtk3-demo has a multi-touch test window that can be useful to visually check that everything is OK within GTK (there aren't so many multi-touch enabled apps out there)