From e75a47315cbce32f9b51002e83fdd001b8f50135 Mon Sep 17 00:00:00 2001 From: K900 Date: Sat, 23 Mar 2024 13:47:40 +0300 Subject: [PATCH 1/3] linux/common-config: reenable schedstats Was disabled in dbdcb3fad435fc531e0bfc71e1b93cc0ff5b0882 for "powertop" kernel variants, which was then merged into default kernels in 77a8ea6fbd474bca969371506ee663e1517. Not really sure why. --- pkgs/os-specific/linux/kernel/common-config.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/os-specific/linux/kernel/common-config.nix b/pkgs/os-specific/linux/kernel/common-config.nix index f46f413f9e0a..337d44199d9f 100644 --- a/pkgs/os-specific/linux/kernel/common-config.nix +++ b/pkgs/os-specific/linux/kernel/common-config.nix @@ -55,7 +55,7 @@ let DYNAMIC_DEBUG = yes; DEBUG_STACK_USAGE = no; RCU_TORTURE_TEST = no; - SCHEDSTATS = no; + SCHEDSTATS = yes; DETECT_HUNG_TASK = yes; CRASH_DUMP = option no; # Easier debugging of NFS issues. From cb39b353041d3fe32ab4f62ac03bccfb652e137e Mon Sep 17 00:00:00 2001 From: K900 Date: Sat, 23 Mar 2024 14:15:44 +0300 Subject: [PATCH 2/3] linux/common-config: enable RC_CORE explicitly Disabled by default in 5.10, needed by MEDIA_CEC_RC --- pkgs/os-specific/linux/kernel/common-config.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/pkgs/os-specific/linux/kernel/common-config.nix b/pkgs/os-specific/linux/kernel/common-config.nix index 337d44199d9f..0553f0eef934 100644 --- a/pkgs/os-specific/linux/kernel/common-config.nix +++ b/pkgs/os-specific/linux/kernel/common-config.nix @@ -450,6 +450,7 @@ let DRM_NOUVEAU_SVM = whenHasDevicePrivate yes; # Enable HDMI-CEC receiver support + RC_CORE = yes; MEDIA_CEC_RC = whenAtLeast "5.10" yes; # Enable CEC over DisplayPort From 1ed5df1e703135d2d6814a761ce67e6e8073af30 Mon Sep 17 00:00:00 2001 From: K900 Date: Sat, 23 Mar 2024 14:16:11 +0300 Subject: [PATCH 3/3] linux/common-config: replace simplefb with simpledrm Arch and Fedora have been shipping it for a while now, we should probably join them in the happy non-fbdev future. Legacy fbdev drivers are still enabled for now, so non-simpledrm-friendly devices don't break. --- .../os-specific/linux/kernel/common-config.nix | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/pkgs/os-specific/linux/kernel/common-config.nix b/pkgs/os-specific/linux/kernel/common-config.nix index 0553f0eef934..a48d2d466e22 100644 --- a/pkgs/os-specific/linux/kernel/common-config.nix +++ b/pkgs/os-specific/linux/kernel/common-config.nix @@ -392,8 +392,8 @@ let FRAMEBUFFER_CONSOLE_ROTATION = yes; FRAMEBUFFER_CONSOLE_DETECT_PRIMARY = yes; FB_GEODE = mkIf (stdenv.hostPlatform.system == "i686-linux") yes; - # On 5.14 this conflicts with FB_SIMPLE. - DRM_SIMPLEDRM = whenAtLeast "5.14" no; + # Use simplefb on older kernels where we don't have simpledrm (enabled below) + FB_SIMPLE = whenOlder "5.15" yes; DRM_FBDEV_EMULATION = yes; }; @@ -409,10 +409,19 @@ let video = let whenHasDevicePrivate = mkIf (!stdenv.isx86_32 && versionAtLeast version "5.1"); in { + # compile in DRM so simpledrm can load before initrd if necessary + AGP = yes; + DRM = yes; + DRM_LEGACY = whenOlder "6.8" no; NOUVEAU_LEGACY_CTX_SUPPORT = whenBetween "5.2" "6.3" no; + # Enable simpledrm and use it for generic framebuffer + # Technically added in 5.14, but adding more complex configuration is not worth it + DRM_SIMPLEDRM = whenAtLeast "5.15" yes; + SYSFB_SIMPLEFB = whenAtLeast "5.15" yes; + # Allow specifying custom EDID on the kernel command line DRM_LOAD_EDID_FIRMWARE = yes; VGA_SWITCHEROO = yes; # Hybrid graphics support @@ -1178,11 +1187,6 @@ let CMA_DEBUGFS = yes; CMA_SYSFS = yes; - # Many ARM SBCs hand off a pre-configured framebuffer. - # This always can can be replaced by the actual native driver. - # Keeping it a built-in ensures it will be used if possible. - FB_SIMPLE = yes; - # https://docs.kernel.org/arch/arm/mem_alignment.html # tldr: # when buggy userspace code emits illegal misaligned LDM, STM,