Skip to content

Commit 99c0ba3

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 99c0ba3

File tree

9 files changed

+597
-0
lines changed

9 files changed

+597
-0
lines changed

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

gpd/duo/duo-specific/amd.nix

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

0 commit comments

Comments
 (0)