From a245aeaef1a311c3a1b84d2259a55ee0b19b1480 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20=C4=8Cun=C3=A1t?= Date: Sun, 16 Mar 2014 18:46:20 +0100 Subject: [PATCH] nixos ati: support glamor, disabled by default This is from @ambrop72 #1969. --- nixos/modules/services/x11/xserver.nix | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/nixos/modules/services/x11/xserver.nix b/nixos/modules/services/x11/xserver.nix index 2677f758456..f422bc0cd2a 100644 --- a/nixos/modules/services/x11/xserver.nix +++ b/nixos/modules/services/x11/xserver.nix @@ -20,6 +20,7 @@ let nvidiaLegacy304 = { modules = [ kernelPackages.nvidia_x11_legacy304 ]; driverName = "nvidia"; }; unichrome = { modules = [ pkgs.xorgVideoUnichrome ]; }; virtualbox = { modules = [ kernelPackages.virtualboxGuestAdditions ]; driverName = "vboxvideo"; }; + ati = { modules = [ pkgs.xorg.xf86videoati pkgs.xorg.glamoregl ]; }; }; driverNames = config.hardware.opengl.videoDrivers; @@ -372,6 +373,14 @@ in ''; }; + useGlamor = mkOption { + type = types.bool; + default = false; + description = '' + Whether to use the Glamor module for 2D acceleration, + if possible. + ''; + }; }; }; @@ -523,6 +532,13 @@ in '')} EndSection + ${if cfg.useGlamor then '' + Section "Module" + Load "dri2" + Load "glamoregl" + EndSection + '' else ""} + # For each supported driver, add a "Device" and "Screen" # section. ${flip concatMapStrings drivers (driver: '' @@ -530,6 +546,7 @@ in Section "Device" Identifier "Device-${driver.name}[0]" Driver "${driver.driverName}" + ${if cfg.useGlamor then ''Option "AccelMethod" "glamor"'' else ""} ${cfg.deviceSection} ${xrandrDeviceSection} EndSection