From 037167ae17fefe6b5dc86dc05f0dd168031c3c68 Mon Sep 17 00:00:00 2001 From: talyz Date: Thu, 7 Jul 2022 14:50:48 +0200 Subject: [PATCH] xf86videointel: Use the `crocus` and `iris` DRI drivers The i965 driver was removed in Mesa 22, but the xf86videointel driver hasn't been updated to reflect this. This leads to the following error when used with the affected hardware: (EE) AIGLX error: dlopen of /run/opengl-driver/lib/dri/i965_dri.so failed (/run/opengl-driver/lib/dri/i965_dri.so: cannot open shared object file: No such file or directory) (EE) AIGLX error: unable to load driver i965 To fix this, add a patch which makes the driver return the appropriate DRI driver name from Mesa 22, i.e. `crocus` for older GPUs and `iris` for newer. --- pkgs/servers/x11/xorg/overrides.nix | 1 + .../x11/xorg/use_crocus_and_iris.patch | 28 +++++++++++++++++++ 2 files changed, 29 insertions(+) create mode 100644 pkgs/servers/x11/xorg/use_crocus_and_iris.patch diff --git a/pkgs/servers/x11/xorg/overrides.nix b/pkgs/servers/x11/xorg/overrides.nix index 2cfd410a3389..e1503a1d05b7 100644 --- a/pkgs/servers/x11/xorg/overrides.nix +++ b/pkgs/servers/x11/xorg/overrides.nix @@ -870,6 +870,7 @@ self: super: buildInputs = attrs.buildInputs ++ [ self.libXScrnSaver self.libXfixes self.libXv self.pixman ]; nativeBuildInputs = attrs.nativeBuildInputs ++ [autoreconfHook self.utilmacros]; configureFlags = [ "--with-default-dri=3" "--enable-tools" ]; + patches = [ ./use_crocus_and_iris.patch ]; meta = attrs.meta // { platforms = ["i686-linux" "x86_64-linux"]; diff --git a/pkgs/servers/x11/xorg/use_crocus_and_iris.patch b/pkgs/servers/x11/xorg/use_crocus_and_iris.patch new file mode 100644 index 000000000000..54744f463bd9 --- /dev/null +++ b/pkgs/servers/x11/xorg/use_crocus_and_iris.patch @@ -0,0 +1,28 @@ +--- a/src/uxa/intel_dri.c ++++ b/src/uxa/intel_dri.c +@@ -1540,8 +1540,10 @@ + return has_i830_dri() ? "i830" : "i915"; + else if (INTEL_INFO(intel)->gen < 040) + return "i915"; ++ else if (INTEL_INFO(intel)->gen < 0100) ++ return "crocus"; + else +- return "i965"; ++ return "iris"; + } + + return s; +--- a/src/sna/sna_dri2.c ++++ b/src/sna/sna_dri2.c +@@ -3707,8 +3707,10 @@ + return has_i830_dri() ? "i830" : "i915"; + else if (sna->kgem.gen < 040) + return "i915"; ++ else if (sna->kgem.gen < 0100) ++ return "crocus"; + else +- return "i965"; ++ return "iris"; + } + + return s;