mirror of
https://github.com/aviallon/nixos-lib.git
synced 2026-04-05 17:27:50 +00:00
[Hardware/Intel] Cleanup intel iGPU specific options littered all over the place
This commit is contained in:
parent
f408f27dbc
commit
3dc72fae02
3 changed files with 33 additions and 14 deletions
|
|
@ -91,9 +91,6 @@ in
|
||||||
|
|
||||||
aviallon.boot.cmdline = mkIf cfg.unsafeOptimizations {
|
aviallon.boot.cmdline = mkIf cfg.unsafeOptimizations {
|
||||||
mitigations = "off";
|
mitigations = "off";
|
||||||
"i915.mitigations" = "off";
|
|
||||||
"i915.enable_dc" = 4;
|
|
||||||
"i915.fastboot" = 1;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
powerManagement.cpuFreqGovernor = mkDefault "schedutil";
|
powerManagement.cpuFreqGovernor = mkDefault "schedutil";
|
||||||
|
|
|
||||||
|
|
@ -2,25 +2,50 @@
|
||||||
with lib;
|
with lib;
|
||||||
let
|
let
|
||||||
cfg = config.aviallon.hardware.intel;
|
cfg = config.aviallon.hardware.intel;
|
||||||
|
generalCfg = config.aviallon.general;
|
||||||
|
laptopCfg = config.aviallon.laptop;
|
||||||
|
devCfg = config.aviallon.developer;
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
options.aviallon.hardware.intel = {
|
options.aviallon.hardware.intel = {
|
||||||
enable = mkEnableOption "Intel GPUs";
|
enable = mkEnableOption "Intel GPUs";
|
||||||
|
iHD = mkEnableOption "Use iHD driver instead of i965";
|
||||||
};
|
};
|
||||||
|
|
||||||
config = mkIf cfg.enable {
|
config = mkIf cfg.enable {
|
||||||
boot.initrd.kernelModules = [ "i915" ];
|
boot.initrd.kernelModules = [ "i915" ];
|
||||||
hardware.opengl = {
|
hardware.opengl = {
|
||||||
enable = true;
|
enable = true;
|
||||||
extraPackages = with pkgs; [
|
extraPackages = with pkgs; []
|
||||||
# intel-media-driver # LIBVA_DRIVER_NAME=iHD
|
++ [
|
||||||
vaapiIntel # LIBVA_DRIVER_NAME=i965 (older but works better for Firefox/Chromium)
|
vaapiVdpau
|
||||||
vaapiVdpau
|
libvdpau-va-gl
|
||||||
libvdpau-va-gl
|
|
||||||
|
|
||||||
intel-graphics-compiler
|
intel-graphics-compiler
|
||||||
intel-compute-runtime
|
intel-compute-runtime
|
||||||
];
|
]
|
||||||
|
++ optional cfg.iHD intel-media-driver # LIBVA_DRIVER_NAME=iHD
|
||||||
|
++ optional (!cfg.iHD) vaapiIntel # LIBVA_DRIVER_NAME=i965 (older but works better for Firefox/Chromium)
|
||||||
|
;
|
||||||
|
};
|
||||||
|
|
||||||
|
aviallon.boot.cmdline = {}
|
||||||
|
// optionalAttrs generalCfg.unsafeOptimizations {
|
||||||
|
"i915.mitigations" = "off";
|
||||||
|
"i915.enable_fbc" = 1;
|
||||||
|
}
|
||||||
|
// optionalAttrs laptopCfg.enable {
|
||||||
|
"i915.enable_fbc" = 1;
|
||||||
|
"i915.enable_dc" = 4;
|
||||||
|
}
|
||||||
|
// optionalAttrs (generalCfg.unsafeOptimizations && laptopCfg.enable) {
|
||||||
|
"i915.enable_psr" = 1;
|
||||||
|
}
|
||||||
|
// optionalAttrs devCfg.enable {
|
||||||
|
"i915.enable_gvt" = 1;
|
||||||
|
}
|
||||||
|
// {
|
||||||
|
"i915.fastboot" = 1;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -28,9 +28,6 @@ in {
|
||||||
hardware.sensor.iio.enable = mkDefault true;
|
hardware.sensor.iio.enable = mkDefault true;
|
||||||
|
|
||||||
aviallon.boot.cmdline = {
|
aviallon.boot.cmdline = {
|
||||||
"i915.enable_fbc" = 1;
|
|
||||||
"i915.enable_gvt" = 1;
|
|
||||||
|
|
||||||
# Less power consumption vs some performance loss
|
# Less power consumption vs some performance loss
|
||||||
"workqueue.power_efficient" = "";
|
"workqueue.power_efficient" = "";
|
||||||
nohz = "on";
|
nohz = "on";
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue