Lenovo ThinkPad P52

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

Peculiarities

 * 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:


 * BIOS in discrete graphics with nVidia-only display (that's the easiest way)
 * BIOS in hybrid graphics with Intel-only display and Bumblebee, no external displays (everything is good except for no external displays)
 * 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 (note I'm editing the page and figuring out what's really essential), a recipe to have everything working is:
 * setup:
 * install bumblebee, bbswitch
 * edit /etc/bumblebee/xorg.conf.nvidia as follows (important bits are UseEDID and AllowEmptyInitialConfiguration):

Section "ServerLayout" Identifier "Layout0" Option     "AutoAddDevices" "false" Option     "AutoAddGPU" "false" EndSection Section "Device" Identifier "DiscreteNvidia" Driver     "nvidia" VendorName "NVIDIA Corporation" BusID "PCI:01:00:0" Option "ProbeAllGpus" "false" Option "NoLogo" "true" Option "UseEDID" "true" Option "AllowEmptyInitialConfiguration" EndSection
 * edit /etc/X11/xorg.conf as follows (:


 * set /etc/bumblebee/bumblebee.conf to have PMMethod=none and KeepUnusedXServer=true, which allows to run optirun true
 * usage:
 * run optirun true to start the Bumblebee Xorg server
 * run intel-virtual-output
 * at this point the plugged external monitors will become available in xrandr, as virtual devices

Thunderbolt
Use tbtadm (sys-apps/thunderbolt-software-user-space) or boltctl (sys-apps/bolt).

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

SD Card Reader
Handled by.

Touchpad
In order to have the trackpoint/touchpad work:


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

Touchscreen
In order to have the touchscreen work:


 * multitouch is handled by the  kernel module
 * multitouch at the X/wayland level is handled by the  X module (*not* wacom!).

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 multitouch test window that can be useful to visually check that everything is OK within GTK (there aren't so many multitouch-enabled apps out there)