Skip to content

Commit 1e21da3

Browse files
mavericm1shymega
andcommitted
gpd/duo: init GPD Duo profile
- Fix boot screen invertion. - Add audio fixes for the Framework 13, given a shared chipset. - Add Bluetooth fixes. - Import AMD 7000-series GPU fix (Raphael). - Add GPD PPT (TDP) control from GPD Win Max 2 - Set `panel_orientation` kernel parameter. - Add AC wakeup fix as a config option; disabled by default. - Enable `power-profiles-daemon` by default, and disable TLP - can be configured. - Disable both PSR and PSR-SU on amdgpu module. - Fix touchscreen properties - upside down rotation Co-authored-by: Dom Rodriguez <[email protected]>
1 parent 497ae13 commit 1e21da3

File tree

10 files changed

+643
-21
lines changed

10 files changed

+643
-21
lines changed

flake.lock

Lines changed: 1 addition & 21 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

flake.nix

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,7 @@
139139
gigabyte-b650 = import ./gigabyte/b650;
140140
gmktec-nucbox-g3-plus = import ./gmktec/nucbox/g3-plus;
141141
google-pixelbook = import ./google/pixelbook;
142+
gpd-duo = import ./gpd/duo;
142143
gpd-micropc = import ./gpd/micropc;
143144
gpd-p2-max = import ./gpd/p2-max;
144145
gpd-pocket-3 = import ./gpd/pocket-3;

gpd/duo/default.nix

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
{
2+
config,
3+
lib,
4+
pkgs,
5+
...
6+
}:
7+
8+
let
9+
cfg = config.hardware.gpd.duo;
10+
in
11+
with lib;
12+
{
13+
imports = [
14+
./duo-specific
15+
../../common/pc/laptop
16+
../../common/pc/ssd
17+
../../common/hidpi.nix
18+
];
19+
20+
options = {
21+
hardware.gpd.duo.preventWakeOnAC = mkOption {
22+
type = types.bool;
23+
default = false;
24+
description = ''
25+
Stop the system waking from suspend when the AC is plugged
26+
in. The catch: it also disables waking from the keyboard.
27+
28+
See:
29+
https://community.frame.work/t/tracking-framework-amd-ryzen-7040-series-lid-wakeup-behavior-feedback/39128/45
30+
'';
31+
};
32+
};
33+
34+
config = {
35+
# Workaround applied upstream in Linux >=6.7 (on BIOS 03.03)
36+
# https://github.com/torvalds/linux/commit/a55bdad5dfd1efd4ed9ffe518897a21ca8e4e193
37+
services.udev.extraRules =
38+
mkIf (versionOlder config.boot.kernelPackages.kernel.version "6.7" && cfg.preventWakeOnAC)
39+
''
40+
# Prevent wake when plugging in AC during suspend. Trade-off: keyboard wake disabled. See:
41+
# https://community.frame.work/t/tracking-framework-amd-ryzen-7040-series-lid-wakeup-behavior-feedback/39128/45
42+
ACTION=="add", SUBSYSTEM=="serio", DRIVERS=="atkbd", ATTR{power/wakeup}="disabled"
43+
'';
44+
45+
# Replace 'left' with 'right' or 'inverted' as needed
46+
# Fixes DUO stupid inverted display at boot
47+
# Enable kernel module for your graphics (adjust if needed)
48+
boot.kernelModules = [ "amdgpu" ];
49+
50+
# Set the eDP-1 panel video parameters for display rotation
51+
boot.kernelParams = mkBefore [
52+
"video=eDP-1:2880x1800,panel_orientation=upside_down"
53+
"video=DP-3:2880x1800"
54+
"i2c_touchscreen_props=GXTP7380:touchscreen-inverted-x:touchscreen-inverted-y"
55+
];
56+
57+
hardware.gpd.duo.audioEnhancement.rawDeviceName =
58+
mkDefault "alsa_output.pci-0000_c1_00.6.analog-stereo";
59+
};
60+
}

gpd/duo/duo-specific/amd.nix

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
{ lib, config, ... }:
2+
with lib;
3+
{
4+
imports = [
5+
../../../common/cpu/amd
6+
../../../common/cpu/amd/pstate.nix
7+
../../../common/gpu/amd
8+
];
9+
10+
boot.kernelParams =
11+
[
12+
# There seems to be an issue with panel self-refresh (PSR) that
13+
# causes hangs for users.
14+
#
15+
# https://community.frame.work/t/fedora-kde-becomes-suddenly-slow/58459
16+
# https://gitlab.freedesktop.org/drm/amd/-/issues/3647
17+
"amdgpu.dcdebugmask=0x210"
18+
]
19+
# Workaround for SuspendThenHibernate: https://lore.kernel.org/linux-kernel/[email protected]/
20+
++ optionals (versionOlder config.boot.kernelPackages.kernel.version "6.8") [
21+
"rtc_cmos.use_acpi_alarm=1"
22+
];
23+
24+
# AMD has better battery life with PPD over TLP:
25+
# https://community.frame.work/t/responded-amd-7040-sleep-states/38101/13
26+
services.power-profiles-daemon.enable = mkDefault true;
27+
services.tlp.enable = mkDefault false;
28+
}

0 commit comments

Comments
 (0)