Dell XPS 13 2-in-1 (7390)

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

Hardware highlights
 * Up to Core i7-1065G7 CPU, 15W TDP
 * Contains some hardware mitigations against Speculative Execution vulnerabilities
 * 11th Gen GPU, up to Iris Plus graphics
 * Up to 32GB of LPDDR4 RAM, clocked at 3773MHz
 * Up to 1TB NVMe SSD storage
 * Up to a 4K (3840x2400), 16:10 aspect ratio touchscreen with 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.


 * Wifi firmware:
 * Bluetooth firmware ,

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.

Firmware:

See also: Intel

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

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.

If using Xorg, set  in. In wayland, the pen is handled by libinput.

Bluetooth Buttons
Some active pens support a bluetooth to the laptop to start up applications. Currently, the bluetooth stack only reports that the device has connected and disconnected, not the type of button press (single, double, and long presses). See xf86-input-wacom "Bluetooth Button" for more info.

(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. The developers have indicated that Ice Lake would be supported in the future.

Feature request: https://github.com/intel/gvt-linux/issues/126

Experimental GuC/HuC
Since iGVT is disabled, it may be possible to get the performance/power-saving benefits of GuC/HuC since it would otherwise be incompatible with iGVT.

Set  in your kernel command line to enable GuC/HuC firmware loading.

Firmware files: ,

VA-API
Set  in   and run:

See bug#692244 if libva-intel-media-driver has compile errors.

Then set vaapi to use the intel-media-driver, instead of the regular intel-driver:

Applications like mpv, vlc and ffmpeg can then use hardware acceleration via vaapi. Check that the GPU is being used for video with '. Browsers don't appear to take advantage of hardware acceleration.

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).

Signed UEFI executable by dracut
Once your Secure Boot keys are in, pop the following into a dracut configuration file:

Then when updating your kernel, run (replace where necessary):

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
If using dracut and plymouth, you'll want a  version greater than 0.2.0, which isn't in the tree, as it contains a ready-to-use dracut module. wants a library called, which is part of  , which is also not in the tree. See its pull request.

Add the tpm2-totp module to dracut's config files:

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. Try disabling BIOS Setup -> POST Behaviour -> "Sign of Life" -> "Early Dell Logo Display".

Discover which sleep modes are available to the system:

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

For instance, it's really easy to press the power button when holding in tablet mode, so I selected 's2idle'/'freeze' for the power key (I repurposed hybrid sleep for it). I then use S3 suspend-to-RAM (deep sleep) on lid close, after which a short timeout to suspend-to-disk (S4), to do a full resume through the bootloader:

Note, when the power button is pressed and the system goes into s2idle, it still responds to the lid closing and going into suspend.

Read more about kernel sleep states

LUKS/resume timeout
If you use hibernation with encrypted swap (with dracut/systemd, but maybe other systems too), the systemd-hibernate-resume service will time out after 90 seconds, and entering your password after that will cause hibernation data loss. Upcoming systemd versions will contain a patch that increases the timeout to infinity, but it'd rather turn the laptop off to save battery power.

Add this to your kernel command line to power off the laptop at the 90 second mark:

See also: Bug report & systemd-hibernate-resume pull request

USB-C PD charging
Plugging in a USB-C PD battery may not do the right thing (i.e. the laptop charges the battery) without the Type-C UCSI driver.

The driver exposes  which configures the ports to pull power, and it can be further configured as a power source or sink.

Fan Thermal Profile
It's pretty self-explanatory except that the 'Cool Bottom' (with a space) mode should be passed as 'cool-bottom' (with a dash):

Filtered calls
You may get some errors while running the smbios tools:

Check dmesg for 'Invalid call'. These calls are filtered by the dell-smbios driver. For some tools, like, the filtered calls can be blacklisted so that the tool can continue running (skipping those filtered calls).

intel-undervolt
All but the 'System Agent' can be undervolted. I experienced GPU glitches below -40mV, and the Tjunction offset goes down to -40°C (100°C-40°C=60°C).

The intel-undervolt.service will re-apply itself after suspend and hibernation, but not on suspend-then-hibernate. Add this to your service override: