Dell XPS 13 2-in-1 (7390)

The Dell XPS 13 2-in-1 (7390, 2019) is an Intel Ice Lake (10th gen, 10nm lithography) convertible, ultra portable laptop.

Hardware highlights
 * Up to Core i7-1065G7 CPU, 15W TDP (not fanless)
 * Up to 32GB of RAM
 * Up to 1TB NVMe SSD storage
 * Up to a 4K 16:10 aspect ratio screen
 * Convertible form-factor, touchscreen and Wacom Active ES 2.0 Pen support
 * UEFI boot only

Hardware not working

 * Fingerprint reader (Goodix)
 * Camera (Intel IPU4)

Target setup
My personal system boots Gentoo as the only operating system (the included Windows 10 installation was wiped). Using Secure Boot and systemd-boot and full-disk (except ESP) LUKS encryption, with the sway window manager. My keyboard layout is United Kingdom (82-key).

Wifi
Model is Intel (Killer Wireless) AX1650i and requires firmware from. Because of the firmware, build the driver as a module, or include the firmware in your kernel build.

Display
You'll also need firmware from in order to use the GPU. It is not recommended to build the GPU firmware into the kernel.

Touchscreen
In kernels before 5.5, the Linux kernel may crash when loading the  module. This will disable the touchscreen and pen input. When booting live media, pass the kernel parameter.

The patches to fix this are included in kernel versions after 5.5.0-rc1 and should be released into the stable 5.5.

If you're using sources from git, you can fetch the patches from the mfd tree, ib-mfd-doc-sparc-libdevres-5.5 branch

Wacom
Need to enable CONFIG_HID_WACOM and CONFIG_PINCTRL_ICELAKE to get a Wacom Active ES 2.0 pen to work.

(Almost) Flicker-free boot
-9999 supports flicker-free boot, but with a couple of noticeable flickers. Set the plymouth theme to. The  parameter is not required.

Intel GVT
Currently iGVT-g is not supported by the i915 driver for Ice Lake. Other modes (iGVT-d, iGVT-s) have not been tested.

Disable keyboard in tablet/tent/stand mode
Other sensors are available (e.g. Ambient Light Sensor, Gyroscope, Inclination and Rotation) in the system, they are not required to disable the keyboard in tablet mode.

Automatic rotation
You can use rot8 or iio-sensor-proxy to automatically rotate your screen. Note, these apps will rotate your screen even in laptop mode, when you may not want it to.

Finger and Pen rotates with screen
Rotating the screen won't automatically rotate the touch and pen input.

Add this to your sway config to fix touch (the pen/"tablet_tool" has issues when rotated, see below):

Issue: Wacom Pen jitter
If the screen has been rotated 90 degrees, you cannot draw straight vertical or horizontal lines with a pen. There isn't a workaround yet.

Sway issue: https://github.com/swaywm/sway/issues/4613

Secure Boot
'  can update the 4 secure boot variables when in setup mode. When in user mode, I copied the public databases onto the ESP and loaded them through the UEFI Setup GUI. Tip:  reboots directly to setup without having to press the Setup key on boot (F2).

OpenSSL engine
Emerge to use the TPM as an OpenSSL engine. To use the tpm resource manager as an unprivileged user, add the user to the  group.

Optional configuration
The engine should not require further configuration, but if you need to you can add the following configuration to  and modify to taste.

TOTP measured boot
Emerge. If using dracut and plymouth, you'll want a version greater than 0.2.0 which isn't in the tree. By default tpm2-totp uses PCR banks 0, 2, 4 and 6. PCR4 contains a hash of the kernel binary you are running, which will change on every kernel update. If you update often, this will cause the TOTP to break each time. Check your PCR banks with '. Adjust which PCR banks are used with the  flag.

Sleep
By default, closing the lid will activate S2 sleep (s2idle), which uses a lot of battery while asleep (~20% overnight).

You can try S3/deep sleep by writing  into   and try suspending again, however there may be issues with the internal display or the touchscreen failing to work on resume. This may also affect hibernation.

Discover which sleep modes are available to the system: $ cat /sys/power/disk [platform] shutdown reboot suspend test_resume $ cat /sys/power/mem_sleep [s2idle] deep $ cat /sys/power/state freeze mem disk

Check the defaults in /etc/systemd/sleep.conf.

For instance, I use freeze/mem(s2idle) on lid close, after which a short timeout to suspend-to-disk (S4), to do a full resume through the bootloader: