From 6478b5d6b918ca05652c89db548cf4ff0a18f4f1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cyryl=20P=C5=82otnicki?= Date: Mon, 5 Dec 2022 15:00:54 +0000 Subject: [PATCH] foureighty - use dri2 as dri3 causes tearing --- nixos/boxes/foureighty/default.nix | 1 + nixos/gfx-intel-dri2.nix | 27 +++++++++++++++++++++++++++ nixos/gfx-intel.nix | 2 +- 3 files changed, 29 insertions(+), 1 deletion(-) create mode 100644 nixos/gfx-intel-dri2.nix diff --git a/nixos/boxes/foureighty/default.nix b/nixos/boxes/foureighty/default.nix index 7b2a9d68..c7b57ae1 100644 --- a/nixos/boxes/foureighty/default.nix +++ b/nixos/boxes/foureighty/default.nix @@ -5,6 +5,7 @@ inputs.nixos-hardware.nixosModules.lenovo-thinkpad-t480 ./hardware-configuration.nix ./thermal.nix + ../../gfx-intel-dri2.nix ../../backups.nix ../../boot.nix ../../distributed-builds.nix diff --git a/nixos/gfx-intel-dri2.nix b/nixos/gfx-intel-dri2.nix new file mode 100644 index 00000000..d95d2b85 --- /dev/null +++ b/nixos/gfx-intel-dri2.nix @@ -0,0 +1,27 @@ +{ config, pkgs, ... }: { + services.xserver = { + videoDrivers = [ "intel" ]; + deviceSection = '' + Option "DRI" "2" + Option "TearFree" "true" + ''; + }; + + hardware.opengl = { + enable = true; + driSupport = true; + extraPackages = with pkgs; [ + vaapiIntel + vaapiVdpau + libvdpau-va-gl + intel-media-driver + ]; + }; + + nixpkgs.config = { + packageOverrides = pkgs: { + vaapiIntel = pkgs.vaapiIntel.override { enableHybridCodec = true; }; + }; + }; + +} diff --git a/nixos/gfx-intel.nix b/nixos/gfx-intel.nix index 78ea00bf..01fab9d7 100644 --- a/nixos/gfx-intel.nix +++ b/nixos/gfx-intel.nix @@ -1,5 +1,5 @@ { config, pkgs, ... }: { - services.xserver.videoDrivers = [ "intel" ]; + services.xserver = { videoDrivers = [ "modesetting" ]; }; hardware.opengl = { enable = true;