tangled
alpha
login
or
join now
pyrox.dev
/
nixpkgs
0
fork
atom
lol
0
fork
atom
overview
issues
pulls
pipelines
Merge #151019: amdgpu-pro: 17.40 -> 21.30
Vladimír Čunát
4 years ago
d856f24d
2caf90b5
+189
-268
8 changed files
expand all
collapse all
unified
split
nixos
modules
hardware
video
amdgpu-pro.nix
services
x11
xserver.nix
pkgs
os-specific
linux
amdgpu-pro
default.nix
patches
0001-fix-warnings-for-Werror.patch
0002-fix-sketchy-int-ptr-warning.patch
0003-disable-firmware-copy.patch
xreallocarray.c
top-level
linux-kernels.nix
+24
-22
nixos/modules/hardware/video/amdgpu-pro.nix
···
11
enabled = elem "amdgpu-pro" drivers;
12
13
package = config.boot.kernelPackages.amdgpu-pro;
14
-
package32 = pkgs.pkgsi686Linux.linuxPackages.amdgpu-pro.override { libsOnly = true; kernel = null; };
15
16
opengl = config.hardware.opengl;
17
18
-
kernel = pkgs.linux_4_9.override {
19
-
extraConfig = ''
20
-
KALLSYMS_ALL y
21
-
'';
22
-
};
23
-
24
in
25
26
{
27
28
config = mkIf enabled {
29
30
-
nixpkgs.config.xorg.abiCompat = "1.19";
31
32
services.xserver.drivers = singleton
33
{ name = "amdgpu"; modules = [ package ]; display = true; };
···
36
hardware.opengl.package32 = package32;
37
hardware.opengl.setLdLibraryPath = true;
38
39
-
boot.extraModulePackages = [ package ];
40
41
-
boot.kernelPackages =
42
-
pkgs.recurseIntoAttrs (pkgs.linuxPackagesFor kernel);
43
-
44
-
boot.blacklistedKernelModules = [ "radeon" ];
0
0
0
45
46
-
hardware.firmware = [ package ];
47
48
system.activationScripts.setup-amdgpu-pro = ''
49
-
mkdir -p /run/lib
50
-
ln -sfn ${package}/lib ${package.libCompatDir}
51
-
ln -sfn ${package} /run/amdgpu-pro
52
-
'' + optionalString opengl.driSupport32Bit ''
53
-
ln -sfn ${package32}/lib ${package32.libCompatDir}
54
'';
55
56
system.requiredKernelConfig = with config.lib.kernelConfig; [
0
57
(isYes "KALLSYMS_ALL")
58
];
59
0
0
0
0
0
0
0
0
0
60
environment.etc = {
61
-
"amd/amdrc".source = package + "/etc/amd/amdrc";
62
-
"amd/amdapfxx.blb".source = package + "/etc/amd/amdapfxx.blb";
63
-
"gbm/gbm.conf".source = package + "/etc/gbm/gbm.conf";
64
};
65
66
};
···
11
enabled = elem "amdgpu-pro" drivers;
12
13
package = config.boot.kernelPackages.amdgpu-pro;
14
+
package32 = pkgs.pkgsi686Linux.linuxPackages.amdgpu-pro.override { kernel = null; };
15
16
opengl = config.hardware.opengl;
17
0
0
0
0
0
0
18
in
19
20
{
21
22
config = mkIf enabled {
23
24
+
nixpkgs.config.xorg.abiCompat = "1.20";
25
26
services.xserver.drivers = singleton
27
{ name = "amdgpu"; modules = [ package ]; display = true; };
···
30
hardware.opengl.package32 = package32;
31
hardware.opengl.setLdLibraryPath = true;
32
33
+
boot.extraModulePackages = [ package.kmod ];
34
35
+
boot.kernelPackages = pkgs.linuxKernel.packagesFor
36
+
(pkgs.linuxKernel.kernels.linux_5_10.override {
37
+
structuredExtraConfig = {
38
+
DEVICE_PRIVATE = kernel.yes;
39
+
KALLSYMS_ALL = kernel.yes;
40
+
};
41
+
});
42
43
+
hardware.firmware = [ package.fw ];
44
45
system.activationScripts.setup-amdgpu-pro = ''
46
+
ln -sfn ${package}/opt/amdgpu{,-pro} /run
0
0
0
0
47
'';
48
49
system.requiredKernelConfig = with config.lib.kernelConfig; [
50
+
(isYes "DEVICE_PRIVATE")
51
(isYes "KALLSYMS_ALL")
52
];
53
54
+
boot.initrd.extraUdevRulesCommands = ''
55
+
cp -v ${package}/etc/udev/rules.d/*.rules $out/
56
+
'';
57
+
58
+
environment.systemPackages =
59
+
[ package.vulkan ] ++
60
+
# this isn't really DRI, but we'll reuse this option for now
61
+
optional config.hardware.opengl.driSupport32Bit package32.vulkan;
62
+
63
environment.etc = {
64
+
"modprobe.d/blacklist-radeon.conf".source = package + "/etc/modprobe.d/blacklist-radeon.conf";
65
+
amd.source = package + "/etc/amd";
0
66
};
67
68
};
+1
-1
nixos/modules/services/x11/xserver.nix
···
703
704
environment =
705
optionalAttrs config.hardware.opengl.setLdLibraryPath
706
-
{ LD_LIBRARY_PATH = pkgs.addOpenGLRunpath.driverLink; }
707
// cfg.displayManager.job.environment;
708
709
preStart =
···
703
704
environment =
705
optionalAttrs config.hardware.opengl.setLdLibraryPath
706
+
{ LD_LIBRARY_PATH = lib.makeLibraryPath [ pkgs.addOpenGLRunpath.driverLink ]; }
707
// cfg.displayManager.job.environment;
708
709
preStart =
+155
-118
pkgs/os-specific/linux/amdgpu-pro/default.nix
···
1
-
{ lib, stdenv, fetchurl, elfutils
2
-
, xorg, patchelf, openssl, libdrm, udev
3
-
, libxcb, libxshmfence, libepoxy, perl, zlib
4
-
, ncurses
5
-
, libsOnly ? false, kernel ? null
0
0
0
0
0
0
0
0
0
0
6
}:
7
8
-
assert (!libsOnly) -> kernel != null;
9
-
10
with lib;
11
12
let
13
14
-
kernelDir = if libsOnly then null else kernel.dev;
15
-
16
bitness = if stdenv.is64bit then "64" else "32";
17
18
libArch =
···
20
"i386-linux-gnu"
21
else if stdenv.hostPlatform.system == "x86_64-linux" then
22
"x86_64-linux-gnu"
23
-
else throw "amdgpu-pro is Linux only. Sorry. The build was stopped.";
24
-
25
-
libReplaceDir = "/usr/lib/${libArch}";
26
-
27
-
ncurses5 = ncurses.override { abiVersion = "5"; };
28
29
in stdenv.mkDerivation rec {
30
31
-
version = "17.40";
32
pname = "amdgpu-pro";
33
-
build = "${version}-492261";
34
-
35
-
libCompatDir = "/run/lib/${libArch}";
36
-
37
-
name = pname + "-" + version + (optionalString (!libsOnly) "-${kernelDir.version}");
38
39
src = fetchurl {
40
-
url =
41
-
"https://www2.ati.com/drivers/linux/ubuntu/amdgpu-pro-${build}.tar.xz";
42
-
sha256 = "1c073lp9cq1rc2mddky2r0j2dv9dd167qj02visz37vwaxbm2r5h";
43
-
curlOpts = "--referer http://support.amd.com/en-us/kb-articles/Pages/AMD-Radeon-GPU-PRO-Linux-Beta-Driver%e2%80%93Release-Notes.aspx";
44
};
45
46
-
hardeningDisable = [ "pic" "format" ];
47
-
48
-
inherit libsOnly;
49
-
50
postUnpack = ''
51
-
cd $sourceRoot
52
mkdir root
53
-
cd root
54
-
for deb in ../*_all.deb ../*_i386.deb '' + optionalString stdenv.is64bit "../*_amd64.deb" + ''; do echo $deb; ar p $deb data.tar.xz | tar -xJ; done
55
-
sourceRoot=.
56
-
'';
57
-
58
-
modulePatches = optionals (!libsOnly) ([
59
-
./patches/0001-fix-warnings-for-Werror.patch
60
-
./patches/0002-fix-sketchy-int-ptr-warning.patch
61
-
./patches/0003-disable-firmware-copy.patch
62
-
]);
63
-
64
-
patchPhase = optionalString (!libsOnly) ''
65
-
pushd usr/src/amdgpu-${build}
66
-
for patch in $modulePatches
67
do
68
-
echo $patch
69
-
patch -f -p1 < $patch || true
70
done
71
popd
0
0
0
72
'';
73
74
-
xreallocarray = ./xreallocarray.c;
0
0
0
75
76
-
preBuild = optionalString (!libsOnly) ''
77
-
pushd usr/src/amdgpu-${build}
78
-
makeFlags="$makeFlags M=$(pwd)"
79
-
patchShebangs pre-build.sh
80
-
./pre-build.sh ${kernel.version}
81
-
popd
82
-
pushd lib
83
-
$CC -fPIC -shared -o libhack-xreallocarray.so $xreallocarray
84
-
strip libhack-xreallocarray.so
85
-
popd
86
-
'';
87
88
-
modules = [
89
-
"amd/amdgpu/amdgpu.ko"
90
-
"amd/amdkcl/amdkcl.ko"
91
-
"ttm/amdttm.ko"
92
-
];
0
93
94
-
postBuild = optionalString (!libsOnly)
95
-
(concatMapStrings (m: "xz usr/src/amdgpu-${build}/${m}\n") modules);
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
96
97
-
NIX_CFLAGS_COMPILE = "-Werror";
0
0
0
98
99
-
makeFlags = optionalString (!libsOnly)
100
-
"-C ${kernel.dev}/lib/modules/${kernel.modDirVersion}/build modules";
101
102
depLibPath = makeLibraryPath [
103
-
stdenv.cc.cc.lib xorg.libXext xorg.libX11 xorg.libXdamage xorg.libXfixes zlib
104
-
xorg.libXxf86vm libxcb libxshmfence libepoxy openssl libdrm elfutils udev ncurses5
0
0
0
0
0
0
0
0
0
0
0
0
0
105
];
106
107
installPhase = ''
0
0
108
mkdir -p $out
109
110
-
cp -r etc $out/etc
111
-
cp -r lib $out/lib
112
113
-
pushd usr
114
-
cp -r lib/${libArch}/* $out/lib
115
-
'' + optionalString (!libsOnly) ''
116
-
cp -r src/amdgpu-${build}/firmware $out/lib/firmware
117
-
'' + ''
118
-
cp -r share $out/share
0
119
popd
120
121
-
pushd opt/amdgpu-pro
122
-
'' + optionalString (!libsOnly && stdenv.is64bit) ''
123
-
cp -r bin $out/bin
124
-
'' + ''
125
-
cp -r include $out/include
126
-
cp -r share/* $out/share
127
-
cp -r lib/${libArch}/* $out/lib
128
-
'' + optionalString (!libsOnly) ''
129
-
mv lib/xorg $out/lib/xorg
130
-
'' + ''
131
popd
132
133
-
'' + optionalString (!libsOnly)
134
-
(concatMapStrings (m:
135
-
"install -Dm444 usr/src/amdgpu-${build}/${m}.xz $out/lib/modules/${kernel.modDirVersion}/kernel/drivers/gpu/drm/${m}.xz\n") modules)
136
-
+ ''
137
-
mv $out/etc/vulkan $out/share
138
-
interpreter="$(cat $NIX_CC/nix-support/dynamic-linker)"
139
-
libPath="$out/lib:$out/lib/gbm:$depLibPath"
140
-
'' + optionalString (!libsOnly && stdenv.is64bit) ''
141
-
for prog in clinfo modetest vbltest kms-universal-planes kms-steal-crtc modeprint amdgpu_test kmstest proptest; do
142
-
patchelf --interpreter "$interpreter" --set-rpath "$libPath" "$out/bin/$prog"
143
-
done
144
'' + ''
145
-
ln -s ${makeLibraryPath [ncurses5]}/libncursesw.so.5 $out/lib/libtinfo.so.5
0
0
0
0
146
'';
147
148
-
# we'll just set the full rpath on everything to avoid having to track down dlopen problems
149
-
postFixup = assert (stringLength libReplaceDir == stringLength libCompatDir); ''
150
-
libPath="$out/lib:$out/lib/gbm:$depLibPath"
151
-
for lib in `find "$out/lib/" -name '*.so*' -type f`; do
152
-
patchelf --set-rpath "$libPath" "$lib"
153
-
done
154
-
for lib in libEGL.so.1 libGL.so.1.2 ${optionalString (!libsOnly) "xorg/modules/extensions/libglx.so"} dri/amdgpu_dri.so libamdocl${bitness}.so; do
155
-
perl -pi -e 's:${libReplaceDir}:${libCompatDir}:g' "$out/lib/$lib"
156
-
done
157
-
for lib in dri/amdgpu_dri.so libdrm_amdgpu.so.1.0.0 libgbm_amdgpu.so.1.0.0 libkms_amdgpu.so.1.0.0 libamdocl${bitness}.so; do
158
-
perl -pi -e 's:/opt/amdgpu-pro/:/run/amdgpu-pro/:g' "$out/lib/$lib"
159
-
done
160
-
substituteInPlace "$out/share/vulkan/icd.d/amd_icd${bitness}.json" --replace "/opt/amdgpu-pro/lib/${libArch}" "$out/lib"
161
-
'' + optionalString (!libsOnly) ''
162
-
for lib in drivers/modesetting_drv.so libglamoregl.so; do
163
-
patchelf --add-needed $out/lib/libhack-xreallocarray.so $out/lib/xorg/modules/$lib
164
-
done
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
165
'';
166
167
buildInputs = [
···
177
license = licenses.unfree;
178
platforms = platforms.linux;
179
maintainers = with maintainers; [ corngood ];
180
-
# Copied from the nvidia default.nix to prevent a store collision.
181
-
priority = 4;
182
};
183
}
···
1
+
{ lib
2
+
, stdenv
3
+
, fetchurl
4
+
, elfutils
5
+
, xorg
6
+
, patchelf
7
+
, libxcb
8
+
, libxshmfence
9
+
, perl
10
+
, zlib
11
+
, expat
12
+
, libffi
13
+
, libselinux
14
+
, udev
15
+
, kernel ? null
16
}:
17
0
0
18
with lib;
19
20
let
21
0
0
22
bitness = if stdenv.is64bit then "64" else "32";
23
24
libArch =
···
26
"i386-linux-gnu"
27
else if stdenv.hostPlatform.system == "x86_64-linux" then
28
"x86_64-linux-gnu"
29
+
else throw "amdgpu-pro is Linux only. Sorry.";
0
0
0
0
30
31
in stdenv.mkDerivation rec {
32
33
+
version = "21.30";
34
pname = "amdgpu-pro";
35
+
build = "${version}-1290604";
0
0
0
0
36
37
src = fetchurl {
38
+
url = "https://drivers.amd.com/drivers/linux/amdgpu-pro-${build}-ubuntu-20.04.tar.xz";
39
+
sha256 = "sha256-WECqxjo2WLP3kMWeVyJgYufkvHTzwGaj57yeMGXiQ4I=";
40
+
curlOpts = "--referer https://www.amd.com/en/support/kb/release-notes/rn-amdgpu-unified-linux-21-30";
0
41
};
42
0
0
0
0
43
postUnpack = ''
0
44
mkdir root
45
+
pushd $sourceRoot
46
+
for deb in *_all.deb *_${if stdenv.is64bit then "amd64" else "i386"}.deb
0
0
0
0
0
0
0
0
0
0
0
0
47
do
48
+
ar p $deb data.tar.xz | tar -C ../root -xJ
0
49
done
50
popd
51
+
# if we don't use a short sourceRoot, compilation can fail due to command
52
+
# line length
53
+
sourceRoot=root
54
'';
55
56
+
passthru = optionalAttrs (kernel != null) {
57
+
kmod = stdenv.mkDerivation rec {
58
+
inherit version src postUnpack;
59
+
name = "${pname}-${version}-kmod-${kernel.dev.version}";
60
61
+
postPatch = ''
62
+
pushd usr/src/amdgpu-*
63
+
patchShebangs amd/dkms/*.sh
64
+
substituteInPlace amd/dkms/pre-build.sh --replace "./configure" "./configure --with-linux=${kernel.dev}/lib/modules/${kernel.modDirVersion}/source --with-linux-obj=${kernel.dev}/lib/modules/${kernel.modDirVersion}/build"
65
+
popd
66
+
'';
0
0
0
0
0
67
68
+
preConfigure = ''
69
+
pushd usr/src/amdgpu-*
70
+
makeFlags="$makeFlags M=$(pwd)"
71
+
amd/dkms/pre-build.sh ${kernel.version}
72
+
popd
73
+
'';
74
75
+
postBuild = ''
76
+
pushd usr/src/amdgpu-*
77
+
find -name \*.ko -exec xz {} \;
78
+
popd
79
+
'';
80
+
81
+
makeFlags = optionalString (kernel != null) "-C ${kernel.dev}/lib/modules/${kernel.modDirVersion}/build modules";
82
+
83
+
installPhase = ''
84
+
runHook preInstall
85
+
86
+
pushd usr/src/amdgpu-*
87
+
find -name \*.ko.xz -exec install -Dm444 {} $out/lib/modules/${kernel.modDirVersion}/kernel/drivers/gpu/drm/{} \;
88
+
popd
89
+
90
+
runHook postInstall
91
+
'';
92
+
93
+
# without this we get a collision with the ttm module from linux
94
+
meta.priority = 4;
95
+
};
96
+
97
+
fw = stdenv.mkDerivation rec {
98
+
inherit version src postUnpack;
99
+
name = "${pname}-${version}-fw";
100
+
101
+
installPhase = ''
102
+
runHook preInstall
103
+
104
+
mkdir -p $out/lib
105
+
cp -r usr/src/amdgpu-*/firmware $out/lib/firmware
106
107
+
runHook postInstall
108
+
'';
109
+
};
110
+
};
111
112
+
outputs = [ "out" "vulkan" ];
0
113
114
depLibPath = makeLibraryPath [
115
+
stdenv.cc.cc.lib
116
+
zlib
117
+
libxcb
118
+
libxshmfence
119
+
elfutils
120
+
expat
121
+
libffi
122
+
libselinux
123
+
# libudev is not listed in any dependencies, but is loaded dynamically
124
+
udev
125
+
xorg.libXext
126
+
xorg.libX11
127
+
xorg.libXfixes
128
+
xorg.libXdamage
129
+
xorg.libXxf86vm
130
];
131
132
installPhase = ''
133
+
runHook preInstall
134
+
135
mkdir -p $out
136
137
+
cp -r usr/lib/${libArch} $out/lib
138
+
cp -r usr/share $out/share
139
140
+
mkdir -p $out/opt/amdgpu{,-pro}
141
+
cp -r opt/amdgpu-pro/lib/${libArch} $out/opt/amdgpu-pro/lib
142
+
cp -r opt/amdgpu/lib/${libArch} $out/opt/amdgpu/lib
143
+
144
+
pushd $out/lib
145
+
ln -s ../opt/amdgpu-pro/lib/libGL.so* .
146
+
ln -s ../opt/amdgpu-pro/lib/libEGL.so* .
147
popd
148
149
+
# short name to allow replacement below
150
+
ln -s lib/dri $out/dri
151
+
152
+
'' + optionalString (stdenv.is64bit) ''
153
+
mkdir -p $out/etc
154
+
pushd etc
155
+
cp -r modprobe.d udev amd $out/etc
0
0
0
156
popd
157
158
+
cp -r lib/udev/rules.d/* $out/etc/udev/rules.d
159
+
cp -r opt/amdgpu/lib/xorg $out/lib/xorg
160
+
cp -r opt/amdgpu-pro/lib/xorg/* $out/lib/xorg
161
+
cp -r opt/amdgpu/share $out/opt/amdgpu/share
0
0
0
0
0
0
0
162
'' + ''
163
+
164
+
mkdir -p $vulkan/share/vulkan/icd.d
165
+
install opt/amdgpu-pro/etc/vulkan/icd.d/amd_icd${bitness}.json $vulkan/share/vulkan/icd.d
166
+
167
+
runHook postInstall
168
'';
169
170
+
preFixup = (if stdenv.is64bit
171
+
# this could also be done with LIBGL_DRIVERS_PATH, but it would need to be
172
+
# set in the user session and for Xorg
173
+
then ''
174
+
expr1='s:/opt/amdgpu/lib/x86_64-linux-gnu/dri\0:/run/opengl-driver/lib/dri\0\0\0\0\0\0\0\0\0\0\0:g'
175
+
expr2='s:/usr/lib/x86_64-linux-gnu/dri[\0\:]:/run/opengl-driver/lib/dri\0\0\0\0:g'
176
+
perl -pi -e "$expr2" $out/lib/xorg/modules/extensions/libglx.so
177
+
''
178
+
else ''
179
+
expr1='s:/opt/amdgpu/lib/i386-linux-gnu/dri\0:/run/opengl-driver-32/lib/dri\0\0\0\0\0\0:g'
180
+
# we replace a different path on 32-bit because it's the only one long
181
+
# enough to fit the target path :(
182
+
expr2='s:/usr/lib/i386-linux-gnu/dri[\0\:]:/run/opengl-driver-32/dri\0\0\0:g'
183
+
'') + ''
184
+
perl -pi -e "$expr1" \
185
+
$out/opt/amdgpu/lib/libEGL.so.1.0.0 \
186
+
$out/opt/amdgpu/lib/libgbm.so.1.0.0 \
187
+
$out/opt/amdgpu/lib/libGL.so.1.2.0
188
+
189
+
perl -pi -e "$expr2" \
190
+
$out/opt/amdgpu-pro/lib/libEGL.so.1 \
191
+
$out/opt/amdgpu-pro/lib/libGL.so.1.2 \
192
+
$out/opt/amdgpu-pro/lib/libGLX_amd.so.0
193
+
194
+
find $out -type f -exec perl -pi -e 's:/opt/amdgpu-pro/:/run/amdgpu-pro/:g' {} \;
195
+
find $out -type f -exec perl -pi -e 's:/opt/amdgpu/:/run/amdgpu/:g' {} \;
196
+
197
+
substituteInPlace $vulkan/share/vulkan/icd.d/*.json --replace /opt/amdgpu-pro/lib/${libArch} "$out/opt/amdgpu-pro/lib"
198
+
'';
199
+
200
+
# doing this in post because shrinking breaks things that dynamically load
201
+
postFixup = ''
202
+
libPath="$out/opt/amdgpu/lib:$out/opt/amdgpu-pro/lib:$depLibPath"
203
+
find "$out" -name '*.so*' -type f -exec patchelf --set-rpath "$libPath" {} \;
204
'';
205
206
buildInputs = [
···
216
license = licenses.unfree;
217
platforms = platforms.linux;
218
maintainers = with maintainers; [ corngood ];
0
0
219
};
220
}
-71
pkgs/os-specific/linux/amdgpu-pro/patches/0001-fix-warnings-for-Werror.patch
···
1
-
From 9167d76c435a7c1df7954f0fbe5cc6d083f8ed2f Mon Sep 17 00:00:00 2001
2
-
From: David McFarland <corngood@gmail.com>
3
-
Date: Mon, 6 Feb 2017 22:13:49 -0400
4
-
Subject: [PATCH 1/3] fix warnings for Werror
5
-
6
-
---
7
-
amd/amdgpu/amdgpu_device.c | 4 ++--
8
-
amd/amdgpu/amdgpu_sa.c | 2 +-
9
-
amd/display/dc/bios/bios_parser2.c | 8 ++++----
10
-
3 files changed, 7 insertions(+), 7 deletions(-)
11
-
12
-
diff --git a/amd/amdgpu/amdgpu_device.c b/amd/amdgpu/amdgpu_device.c
13
-
index fc1c543..186e06d 100644
14
-
--- a/amd/amdgpu/amdgpu_device.c
15
-
+++ b/amd/amdgpu/amdgpu_device.c
16
-
@@ -3164,7 +3164,7 @@ void amdgpu_debugfs_cleanup(struct drm_minor *minor)
17
-
struct drm_info_node *node, *tmp;
18
-
19
-
if (!&minor->debugfs_root)
20
-
- return 0;
21
-
+ return;
22
-
23
-
mutex_lock(&minor->debugfs_lock);
24
-
list_for_each_entry_safe(node, tmp,
25
-
@@ -3175,7 +3175,7 @@ void amdgpu_debugfs_cleanup(struct drm_minor *minor)
26
-
}
27
-
mutex_unlock(&minor->debugfs_lock);
28
-
29
-
- return 0;
30
-
+ return;
31
-
}
32
-
#endif
33
-
34
-
diff --git a/amd/amdgpu/amdgpu_sa.c b/amd/amdgpu/amdgpu_sa.c
35
-
index 7206b34..8b7123c 100644
36
-
--- a/amd/amdgpu/amdgpu_sa.c
37
-
+++ b/amd/amdgpu/amdgpu_sa.c
38
-
@@ -430,7 +430,7 @@ void amdgpu_sa_bo_dump_debug_info(struct amdgpu_sa_manager *sa_manager,
39
-
if (i->fence)
40
-
#if defined(BUILD_AS_DKMS)
41
-
seq_printf(m, " protected by 0x%08x on context %d",
42
-
- i->fence->seqno, i->fence->context);
43
-
+ i->fence->seqno, (int)i->fence->context);
44
-
#else
45
-
seq_printf(m, " protected by 0x%08x on context %llu",
46
-
i->fence->seqno, i->fence->context);
47
-
diff --git a/amd/display/dc/bios/bios_parser2.c b/amd/display/dc/bios/bios_parser2.c
48
-
index 86fce5a..99681c5 100644
49
-
--- a/amd/display/dc/bios/bios_parser2.c
50
-
+++ b/amd/display/dc/bios/bios_parser2.c
51
-
@@ -1326,13 +1326,13 @@ static enum bp_result get_embedded_panel_info_v2_1(
52
-
info->lcd_timing.misc_info.VERTICAL_CUT_OFF = 0;
53
-
54
-
info->lcd_timing.misc_info.H_REPLICATION_BY2 =
55
-
- lvds->lcd_timing.miscinfo & ATOM_H_REPLICATIONBY2;
56
-
+ (lvds->lcd_timing.miscinfo & ATOM_H_REPLICATIONBY2) != 0;
57
-
info->lcd_timing.misc_info.V_REPLICATION_BY2 =
58
-
- lvds->lcd_timing.miscinfo & ATOM_V_REPLICATIONBY2;
59
-
+ (lvds->lcd_timing.miscinfo & ATOM_V_REPLICATIONBY2) != 0;
60
-
info->lcd_timing.misc_info.COMPOSITE_SYNC =
61
-
- lvds->lcd_timing.miscinfo & ATOM_COMPOSITESYNC;
62
-
+ (lvds->lcd_timing.miscinfo & ATOM_COMPOSITESYNC) != 0;
63
-
info->lcd_timing.misc_info.INTERLACE =
64
-
- lvds->lcd_timing.miscinfo & ATOM_INTERLACE;
65
-
+ (lvds->lcd_timing.miscinfo & ATOM_INTERLACE) != 0;
66
-
67
-
/* not provided by VBIOS*/
68
-
info->lcd_timing.misc_info.DOUBLE_CLOCK = 0;
69
-
--
70
-
2.15.1
71
-
···
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
-25
pkgs/os-specific/linux/amdgpu-pro/patches/0002-fix-sketchy-int-ptr-warning.patch
···
1
-
From a07ee5dec35ca24a013a6638543ef5030b2bab40 Mon Sep 17 00:00:00 2001
2
-
From: David McFarland <corngood@gmail.com>
3
-
Date: Tue, 9 Jan 2018 21:45:33 -0400
4
-
Subject: [PATCH 2/3] fix sketchy int->ptr warning
5
-
6
-
---
7
-
amd/display/amdgpu_dm/amdgpu_dm_helpers.c | 2 +-
8
-
1 file changed, 1 insertion(+), 1 deletion(-)
9
-
10
-
diff --git a/amd/display/amdgpu_dm/amdgpu_dm_helpers.c b/amd/display/amdgpu_dm/amdgpu_dm_helpers.c
11
-
index d0f091b..707815a 100644
12
-
--- a/amd/display/amdgpu_dm/amdgpu_dm_helpers.c
13
-
+++ b/amd/display/amdgpu_dm/amdgpu_dm_helpers.c
14
-
@@ -236,7 +236,7 @@ bool dm_helpers_dp_mst_write_payload_allocation_table(
15
-
pbn = drm_dp_calc_pbn_mode(clock, bpp);
16
-
17
-
slots = drm_dp_find_vcpi_slots(mst_mgr, pbn);
18
-
- ret = drm_dp_mst_allocate_vcpi(mst_mgr, mst_port, pbn, slots);
19
-
+ ret = drm_dp_mst_allocate_vcpi(mst_mgr, mst_port, pbn, &slots);
20
-
21
-
if (!ret)
22
-
return false;
23
-
--
24
-
2.15.1
25
-
···
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
-25
pkgs/os-specific/linux/amdgpu-pro/patches/0003-disable-firmware-copy.patch
···
1
-
From 7a3062acbbabdb29239bbc8c984e62589a88576e Mon Sep 17 00:00:00 2001
2
-
From: David McFarland <corngood@gmail.com>
3
-
Date: Tue, 9 Jan 2018 21:49:55 -0400
4
-
Subject: [PATCH 3/3] disable firmware copy
5
-
6
-
---
7
-
pre-build.sh | 5 -----
8
-
1 file changed, 5 deletions(-)
9
-
10
-
diff --git a/pre-build.sh b/pre-build.sh
11
-
index e7b8a32..bad8f25 100755
12
-
--- a/pre-build.sh
13
-
+++ b/pre-build.sh
14
-
@@ -38,8 +38,3 @@ find ttm -name '*.c' -exec grep EXPORT_SYMBOL {} + \
15
-
| sort -u \
16
-
| awk -F'[()]' '{print "#define "$2" amd"$2" //"$0}'\
17
-
>> include/rename_symbol.h
18
-
-
19
-
-FW_DIR="/lib/firmware/$KERNELVER"
20
-
-mkdir -p $FW_DIR
21
-
-cp -ar /usr/src/amdgpu-17.40-492261/firmware/radeon $FW_DIR
22
-
-cp -ar /usr/src/amdgpu-17.40-492261/firmware/amdgpu $FW_DIR
23
-
--
24
-
2.15.1
25
-
···
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
-5
pkgs/os-specific/linux/amdgpu-pro/xreallocarray.c
···
1
-
#include <malloc.h>
2
-
3
-
void *xreallocarray(void *ptr, size_t nmemb, size_t size) {
4
-
return reallocarray(ptr, nmemb, size);
5
-
}
···
0
0
0
0
0
+9
-1
pkgs/top-level/linux-kernels.nix
···
248
249
akvcam = callPackage ../os-specific/linux/akvcam { };
250
251
-
amdgpu-pro = callPackage ../os-specific/linux/amdgpu-pro { };
0
0
0
0
0
0
0
0
252
253
anbox = callPackage ../os-specific/linux/anbox/kmod.nix { };
254
···
248
249
akvcam = callPackage ../os-specific/linux/akvcam { };
250
251
+
amdgpu-pro = callPackage ../os-specific/linux/amdgpu-pro {
252
+
libffi = pkgs.libffi.overrideAttrs (orig: rec {
253
+
version = "3.3";
254
+
src = fetchurl {
255
+
url = "https://github.com/libffi/libffi/releases/download/v${version}/${orig.pname}-${version}.tar.gz";
256
+
sha256 = "0mi0cpf8aa40ljjmzxb7im6dbj45bb0kllcd09xgmp834y9agyvj";
257
+
};
258
+
});
259
+
};
260
261
anbox = callPackage ../os-specific/linux/anbox/kmod.nix { };
262