Skip to content

Commit

Permalink
Merge pull request #298332 from K900/continued-kernel-shenanigans
Browse files Browse the repository at this point in the history
linux/common-config: more tweaks, some repeated tweaks
  • Loading branch information
K900 authored Mar 24, 2024
2 parents 25bfb6e + 1ed5df1 commit edeff1b
Showing 1 changed file with 13 additions and 8 deletions.
21 changes: 13 additions & 8 deletions pkgs/os-specific/linux/kernel/common-config.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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;
};

Expand All @@ -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
Expand Down Expand Up @@ -450,6 +459,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
Expand Down Expand Up @@ -1177,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,
Expand Down

0 comments on commit edeff1b

Please sign in to comment.