From 0cd562157274df3783840bdcb0ce6d9c4cf4aa29 Mon Sep 17 00:00:00 2001 From: John Titor <50095635+JohnRTitor@users.noreply.github.com> Date: Sat, 15 Jun 2024 18:52:13 +0530 Subject: [PATCH] amd/cpu/raphael-igpu: enable scatter/gather for kernel 6.6+ Scatter/gather was introduced in 6.2 kernel and caused flickering and various issues when running iGPU on Ryzen 7000-series CPUs. This issue is not observed in kernel 6.6 or newer versions so we can enable it for kernel 6.6 and newer versions. --- common/cpu/amd/raphael/igpu.nix | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/common/cpu/amd/raphael/igpu.nix b/common/cpu/amd/raphael/igpu.nix index b094077..71b1152 100644 --- a/common/cpu/amd/raphael/igpu.nix +++ b/common/cpu/amd/raphael/igpu.nix @@ -1,9 +1,15 @@ -{ lib, pkgs, config, ... }: +{ + lib, + pkgs, + config, + ... +}: { # Sets the kernel version to the latest kernel to make the usage of the iGPU possible if your kernel version is too old # Disables scatter/gather which was introduced with kernel version 6.2 # It produces completely white or flashing screens when enabled while using the iGPU of Ryzen 7000-series CPUs (Raphael) + # This issue is not seen in kernel 6.6 or newer versions imports = [ ../. ]; @@ -12,8 +18,9 @@ kernelPackages = pkgs.linuxPackages_latest; }) - (lib.mkIf (lib.versionAtLeast config.boot.kernelPackages.kernel.version "6.2") { - kernelParams = ["amdgpu.sg_display=0"]; - }) + (lib.mkIf ( + (lib.versionAtLeast config.boot.kernelPackages.kernel.version "6.2") + && (lib.versionOlder config.boot.kernelPackages.kernel.version "6.6") + ) { kernelParams = [ "amdgpu.sg_display=0" ]; }) ]; }