Skip to content

Instantly share code, notes, and snippets.

@guilhem
Last active May 28, 2022 06:09
Show Gist options
  • Save guilhem/db3cd89e83ca3ab0e7bae472ad86fa2f to your computer and use it in GitHub Desktop.
Save guilhem/db3cd89e83ca3ab0e7bae472ad86fa2f to your computer and use it in GitHub Desktop.
Optimization for Dell XPS 13 7390 2-in-1 on Ubuntu 19.10 (2019-10-27)

Bios

Disable:

  • thunderbolt → wakeup from suspend (fix in 5.4)
  • fingerprint → no driver for Goodix Fingerprint
  • camera → no driver for Intel AVStream Camera

Services

Disable:

  • iio-sensor-proxy.service → bug in kernel spam logs when using sensors
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash mitigations=off mem_sleep_default=deep acpi_osi=Linux"
options dell-smm-hwmon ignore_dmi=1
blacklist psmouse
options i915 enable_fbc=1 enable_guc=3 enable_dc=2 enable_psr=1 enable_dpcd_backlight=1 fastboot=1 disable_power_well=0
export LIBVA_DRIVER_NAME=iHD
[Unit]
Description=Disable hissing sound with headphones
After=pulseaudio.service
PartOf=pulseaudio.service
[Service]
Type=oneshot
ExecStart=amixer -c PCH cset 'name=Headphone Mic Boost Volume' 1
[Install]
WantedBy=pulseaudio.service
SUBSYSTEM=="power_supply", DRIVERS=="ac", ATTR{type}=="Mains", TAG+="systemd", ENV{SYSTEMD_ALIAS}="/sys/subsystem/power_supply/main_AC", ENV{SYSTEMD_READY}="$env{POWER_SUPPLY_ONLINE}"
#!/bin/bash
set -xeu -o pipefail
resolution="$1"
scale="$2"
function get_serial() {
serial="$(gdbus call --session --dest org.gnome.Mutter.DisplayConfig \
--object-path /org/gnome/Mutter/DisplayConfig \
--method org.gnome.Mutter.DisplayConfig.GetResources | awk '{print $2}' | tr -d ',')"
echo $serial
}
serial=$(get_serial)
gdbus call --session --dest org.gnome.Mutter.DisplayConfig \
--object-path /org/gnome/Mutter/DisplayConfig \
--method org.gnome.Mutter.DisplayConfig.ApplyMonitorsConfig \
$serial 1 "[(0, 0, $scale, 0, true, [('eDP-1', '$resolution', [] )] )]" "[]"
[Unit]
StopWhenUnneeded=yes
[Service]
Type=oneshot
RemainAfterExit=yes
ExecStart=/usr/local/bin/change-resolution [email protected] 2
ExecStop=/usr/local/bin/change-resolution [email protected] 1
[Install]
WantedBy=sys-subsystem-power_supply-main_AC.device
@davydes
Copy link

davydes commented Feb 21, 2020

What is 90-ac.rules for? I'm trying to tune my XPS 7390 but no 2 in 1, because I have Win version.
Seems almost all woks out of box, but I noticed high power consumption at standby mode.

@guilhem
Copy link
Author

guilhem commented Feb 21, 2020

What is 90-ac.rules for? I'm trying to tune my XPS 7390 but no 2 in 1, because I have Win version.
Seems almost all woks out of box, but I noticed high power consumption at standby mode.

This is to be able to trigger some systemd units when AC is plugged.
It doesn't do anything about power consumption :/

@davydes
Copy link

davydes commented Feb 21, 2020

What is 90-ac.rules for? I'm trying to tune my XPS 7390 but no 2 in 1, because I have Win version.
Seems almost all woks out of box, but I noticed high power consumption at standby mode.

This is to be able to trigger some systemd units when AC is plugged.
It doesn't do anything about power consumption :/

Yeah, I see, but i think options of i915 module can improve power saving. I hope.

@guilhem
Copy link
Author

guilhem commented Feb 21, 2020

Using TLP + kernel 5.5+ can also improve a lot

@dkout
Copy link

dkout commented Mar 17, 2020

Has anyone had luck with getting the webcam working? I would imagine it should not be very hard given it works on the 2020 version of the dell xps 13 developer edition which has incredibly similar hardware. Any ideas on how we might use that driver?

@spotlesscoder
Copy link

Has anyone had luck with getting the webcam working? I would imagine it should not be very hard given it works on the 2020 version of the dell xps 13 developer edition which has incredibly similar hardware. Any ideas on how we might use that driver?

I'd also really really love to use the webcam on the 2019 model.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment