tangled
alpha
login
or
join now
pyrox.dev
/
nixpkgs
0
fork
atom
lol
0
fork
atom
overview
issues
pulls
pipelines
Merge #22241: amdgpu-pro: 16.50 -> 16.60
Vladimír Čunát
9 years ago
ce9d30e7
11621b9e
+244
-738
20 changed files
expand all
collapse all
unified
split
nixos
modules
hardware
video
amdgpu-pro.nix
ati.nix
pkgs
os-specific
linux
amdgpu-pro
default.nix
patches
0001-Fix-kernel-module-install-location.patch
0001-disable-firmware-copy.patch
0002-Add-Gentoo-as-build-option.patch
0002-linux-4.9-fixes.patch
0003-Change-seq_printf-format-for-64-bit-context.patch
0003-Remove-extra-parameter-from-ttm_bo_reserve-for-4.7.0.patch
0004-fix-warnings-for-Werror.patch
0005-Fix-vblank-calls.patch
0006-Fix-crtc_gamma-functions-for-4.8.0.patch
0007-Fix-drm_atomic_helper_swap_state-for-4.8.0.patch
0008-Add-extra-flag-to-ttm_bo_move_ttm-for-4.8.0-rc2.patch
0009-Remove-dependency-on-System.map.patch
0010-disable-dal-by-default.patch
0011-kcl-fixes-for-16.50-linux-4.8.patch
0012-use-kernel-fence_array-in-4.8.patch
servers
x11
xorg
overrides.nix
top-level
all-packages.nix
+2
nixos/modules/hardware/video/amdgpu-pro.nix
···
21
22
config = mkIf enabled {
23
0
0
24
services.xserver.drivers = singleton
25
{ name = "amdgpu"; modules = [ package ]; libPath = [ package ]; };
26
···
21
22
config = mkIf enabled {
23
24
+
nixpkgs.config.xorg.abiCompat = "1.18";
25
+
26
services.xserver.drivers = singleton
27
{ name = "amdgpu"; modules = [ package ]; libPath = [ package ]; };
28
+1
-1
nixos/modules/hardware/video/ati.nix
···
18
19
config = mkIf enabled {
20
21
-
nixpkgs.config.xorg.fglrxCompat = true;
22
23
services.xserver.drivers = singleton
24
{ name = "fglrx"; modules = [ ati_x11 ]; libPath = [ "${ati_x11}/lib" ]; };
···
18
19
config = mkIf enabled {
20
21
+
nixpkgs.config.xorg.abiCompat = "1.17";
22
23
services.xserver.drivers = singleton
24
{ name = "fglrx"; modules = [ ati_x11 ]; libPath = [ "${ati_x11}/lib" ]; };
+26
-23
pkgs/os-specific/linux/amdgpu-pro/default.nix
···
30
31
in stdenv.mkDerivation rec {
32
33
-
version = "16.50";
34
pname = "amdgpu-pro";
35
-
build = "${version}-362463";
36
37
libCompatDir = "/run/lib/${libArch}";
38
···
41
src = fetchurl {
42
url =
43
"https://www2.ati.com/drivers/linux/ubuntu/amdgpu-pro-${build}.tar.xz";
44
-
sha256 = "1wl8mabk9g7s43bdarzl2i5crp8rl1advnb5mw3p3821sqzh2nd9";
45
curlOpts = "--referer http://support.amd.com/en-us/kb-articles/Pages/AMD-Radeon-GPU-PRO-Linux-Beta-Driver%e2%80%93Release-Notes.aspx";
46
};
47
···
58
'';
59
60
modulePatches = [
61
-
./patches/0001-Fix-kernel-module-install-location.patch
62
-
./patches/0002-Add-Gentoo-as-build-option.patch
63
-
./patches/0003-Remove-extra-parameter-from-ttm_bo_reserve-for-4.7.0.patch
64
-
./patches/0004-Change-seq_printf-format-for-64-bit-context.patch
65
-
./patches/0005-Fix-vblank-calls.patch
66
-
./patches/0006-Fix-crtc_gamma-functions-for-4.8.0.patch
67
-
./patches/0007-Fix-drm_atomic_helper_swap_state-for-4.8.0.patch
68
-
./patches/0008-Add-extra-flag-to-ttm_bo_move_ttm-for-4.8.0-rc2.patch
69
-
./patches/0009-Remove-dependency-on-System.map.patch
70
-
./patches/0010-disable-dal-by-default.patch
71
-
./patches/0011-kcl-fixes-for-16.50-linux-4.8.patch
72
-
./patches/0012-use-kernel-fence_array-in-4.8.patch
73
];
74
75
patchPhase = optionalString (!libsOnly) ''
···
83
'';
84
85
preBuild = optionalString (!libsOnly) ''
86
-
makeFlags="$makeFlags M=$(pwd)/usr/src/amdgpu-pro-${build}"
0
0
0
0
87
'';
88
89
-
postBuild = optionalString (!libsOnly) ''
90
-
xz usr/src/amdgpu-pro-${build}/amd/amdgpu/amdgpu.ko
91
-
'';
0
0
0
0
0
0
0
92
93
makeFlags = optionalString (!libsOnly)
94
"-C ${kernel.dev}/lib/modules/${kernel.modDirVersion}/build modules";
···
123
'' + ''
124
popd
125
126
-
'' + optionalString (!libsOnly) ''
127
-
mkdir -p $out/lib/modules/${kernel.modDirVersion}/kernel/drivers/gpu/drm/amd/amdgpu/amdgpu.ko.xz
128
-
cp usr/src/amdgpu-pro-${build}/amd/amdgpu/amdgpu.ko.xz $out/lib/modules/${kernel.modDirVersion}/kernel/drivers/gpu/drm/amd/amdgpu/amdgpu.ko.xz
129
-
'' + ''
130
mv $out/etc/vulkan $out/share
131
interpreter="$(cat $NIX_CC/nix-support/dynamic-linker)"
132
libPath="$out/lib:$out/lib/gbm:$depLibPath"
···
30
31
in stdenv.mkDerivation rec {
32
33
+
version = "16.60";
34
pname = "amdgpu-pro";
35
+
build = "${version}-379184";
36
37
libCompatDir = "/run/lib/${libArch}";
38
···
41
src = fetchurl {
42
url =
43
"https://www2.ati.com/drivers/linux/ubuntu/amdgpu-pro-${build}.tar.xz";
44
+
sha256 = "1g90sryxw8y4abjgviibq34v3hr82ijgbaiqnxgafrf7g9s5m2yq";
45
curlOpts = "--referer http://support.amd.com/en-us/kb-articles/Pages/AMD-Radeon-GPU-PRO-Linux-Beta-Driver%e2%80%93Release-Notes.aspx";
46
};
47
···
58
'';
59
60
modulePatches = [
61
+
./patches/0001-disable-firmware-copy.patch
62
+
./patches/0002-linux-4.9-fixes.patch
63
+
./patches/0003-Change-seq_printf-format-for-64-bit-context.patch
64
+
./patches/0004-fix-warnings-for-Werror.patch
0
0
0
0
0
0
0
0
65
];
66
67
patchPhase = optionalString (!libsOnly) ''
···
75
'';
76
77
preBuild = optionalString (!libsOnly) ''
78
+
pushd usr/src/amdgpu-pro-${build}
79
+
makeFlags="$makeFlags M=$(pwd)"
80
+
patchShebangs pre-build.sh
81
+
./pre-build.sh ${kernel.version}
82
+
popd
83
'';
84
85
+
modules = [
86
+
"amd/amdgpu/amdgpu.ko"
87
+
"amd/amdkcl/amdkcl.ko"
88
+
"ttm/amdttm.ko"
89
+
];
90
+
91
+
postBuild = optionalString (!libsOnly)
92
+
(concatMapStrings (m: "xz usr/src/amdgpu-pro-${build}/${m}\n") modules);
93
+
94
+
NIX_CFLAGS_COMPILE = "-Werror";
95
96
makeFlags = optionalString (!libsOnly)
97
"-C ${kernel.dev}/lib/modules/${kernel.modDirVersion}/build modules";
···
126
'' + ''
127
popd
128
129
+
'' + optionalString (!libsOnly)
130
+
(concatMapStrings (m:
131
+
"install -Dm444 usr/src/amdgpu-pro-${build}/${m}.xz $out/lib/modules/${kernel.modDirVersion}/kernel/drivers/gpu/drm/${m}.xz\n") modules)
132
+
+ ''
133
mv $out/etc/vulkan $out/share
134
interpreter="$(cat $NIX_CC/nix-support/dynamic-linker)"
135
libPath="$out/lib:$out/lib/gbm:$depLibPath"
-25
pkgs/os-specific/linux/amdgpu-pro/patches/0001-Fix-kernel-module-install-location.patch
···
1
-
From e787277fd4f43399de2da355b08e478c2a58d589 Mon Sep 17 00:00:00 2001
2
-
From: "Luke A. Guest" <laguest@archeia.com>
3
-
Date: Sun, 25 Sep 2016 15:31:13 +0100
4
-
Subject: [PATCH 01/11] Fix kernel module install location
5
-
6
-
---
7
-
dkms.conf | 2 +-
8
-
1 file changed, 1 insertion(+), 1 deletion(-)
9
-
10
-
diff --git a/dkms.conf b/dkms.conf
11
-
index 7f11158..2f080e2 100644
12
-
--- a/dkms.conf
13
-
+++ b/dkms.conf
14
-
@@ -2,7 +2,7 @@ PACKAGE_NAME="amdgpu-pro"
15
-
PACKAGE_VERSION="16.50-362463"
16
-
BUILT_MODULE_NAME[0]="amdgpu"
17
-
BUILT_MODULE_LOCATION[0]="amd/amdgpu"
18
-
-DEST_MODULE_LOCATION[0]="/updates"
19
-
+DEST_MODULE_LOCATION[0]="/kernel/drivers/gpu/drm/amd/amdgpu"
20
-
AUTOINSTALL="yes"
21
-
PRE_BUILD="pre-build.sh $kernelver"
22
-
23
-
--
24
-
2.11.0
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/0001-disable-firmware-copy.patch
···
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
···
1
+
From ad3f6de6d16ea8ee76635dd39875eeab39def6e9 Mon Sep 17 00:00:00 2001
2
+
From: David McFarland <corngood@gmail.com>
3
+
Date: Sat, 28 Jan 2017 16:57:26 -0400
4
+
Subject: [PATCH 1/4] 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 25e718f..e3cd009 100755
12
+
--- a/pre-build.sh
13
+
+++ b/pre-build.sh
14
+
@@ -35,8 +35,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-pro-16.60-379184/firmware/radeon $FW_DIR
22
+
-cp -ar /usr/src/amdgpu-pro-16.60-379184/firmware/amdgpu $FW_DIR
23
+
--
24
+
2.11.0
25
+
-30
pkgs/os-specific/linux/amdgpu-pro/patches/0002-Add-Gentoo-as-build-option.patch
···
1
-
From da51551f671be3282b6f69ef76e495b169a5dc3f Mon Sep 17 00:00:00 2001
2
-
From: "Luke A. Guest" <laguest@archeia.com>
3
-
Date: Sun, 25 Sep 2016 15:31:49 +0100
4
-
Subject: [PATCH 02/11] Add Gentoo as build option
5
-
6
-
---
7
-
amd/backport/Makefile | 5 +++++
8
-
1 file changed, 5 insertions(+)
9
-
10
-
diff --git a/amd/backport/Makefile b/amd/backport/Makefile
11
-
index a6ab7fe..ff9339d 100644
12
-
--- a/amd/backport/Makefile
13
-
+++ b/amd/backport/Makefile
14
-
@@ -22,8 +22,13 @@ else ifeq ("sled",$(OS_NAME))
15
-
ccflags-y += -DOS_NAME_SLE
16
-
else ifeq ("sles",$(OS_NAME))
17
-
ccflags-y += -DOS_NAME_SLE
18
-
+else ifeq ("gentoo",$(OS_NAME))
19
-
+ccflags-y += -DOS_NAME_GENTOO
20
-
+# We don't have a version inside /etc/os-release.
21
-
+OS_VERSION = "0.0"
22
-
else
23
-
ccflags-y += -DOS_NAME_UNKNOWN
24
-
+OS_VERSION = "0.0"
25
-
endif
26
-
27
-
ccflags-y += \
28
-
--
29
-
2.11.0
30
-
···
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
+97
pkgs/os-specific/linux/amdgpu-pro/patches/0002-linux-4.9-fixes.patch
···
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
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
···
1
+
From 52e47be93c7a492730477f590e5eb42e035018bd Mon Sep 17 00:00:00 2001
2
+
From: David McFarland <corngood@gmail.com>
3
+
Date: Sun, 29 Jan 2017 18:23:47 -0400
4
+
Subject: [PATCH 2/4] linux-4.9 fixes
5
+
6
+
---
7
+
amd/amdgpu/amdgpu_connectors.c | 8 ++++++++
8
+
amd/amdgpu/amdgpu_ttm.c | 4 ++++
9
+
amd/display/amdgpu_dm/amdgpu_dm_types.c | 8 ++++++++
10
+
include/kcl/kcl_mm.h | 4 +++-
11
+
4 files changed, 23 insertions(+), 1 deletion(-)
12
+
13
+
diff --git a/amd/amdgpu/amdgpu_connectors.c b/amd/amdgpu/amdgpu_connectors.c
14
+
index 1b51981..4b43379 100644
15
+
--- a/amd/amdgpu/amdgpu_connectors.c
16
+
+++ b/amd/amdgpu/amdgpu_connectors.c
17
+
@@ -168,12 +168,20 @@ int amdgpu_connector_get_monitor_bpc(struct drm_connector *connector)
18
+
}
19
+
20
+
/* Any defined maximum tmds clock limit we must not exceed? */
21
+
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 9, 0)
22
+
+ if (connector->display_info.max_tmds_clock > 0) {
23
+
+#else
24
+
if (connector->max_tmds_clock > 0) {
25
+
+#endif
26
+
/* mode_clock is clock in kHz for mode to be modeset on this connector */
27
+
mode_clock = amdgpu_connector->pixelclock_for_modeset;
28
+
29
+
/* Maximum allowable input clock in kHz */
30
+
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 9, 0)
31
+
+ max_tmds_clock = connector->display_info.max_tmds_clock * 1000;
32
+
+#else
33
+
max_tmds_clock = connector->max_tmds_clock * 1000;
34
+
+#endif
35
+
36
+
DRM_DEBUG("%s: hdmi mode dotclock %d kHz, max tmds input clock %d kHz.\n",
37
+
connector->name, mode_clock, max_tmds_clock);
38
+
diff --git a/amd/amdgpu/amdgpu_ttm.c b/amd/amdgpu/amdgpu_ttm.c
39
+
index 447529d..252bab4 100644
40
+
--- a/amd/amdgpu/amdgpu_ttm.c
41
+
+++ b/amd/amdgpu/amdgpu_ttm.c
42
+
@@ -255,7 +255,11 @@ static int amdgpu_verify_access(struct ttm_buffer_object *bo, struct file *filp)
43
+
44
+
if (amdgpu_ttm_tt_get_usermm(bo->ttm))
45
+
return -EPERM;
46
+
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 9, 0)
47
+
+ return drm_vma_node_verify_access(&abo->gem_base.vma_node, filp->private_data);
48
+
+#else
49
+
return drm_vma_node_verify_access(&abo->gem_base.vma_node, filp);
50
+
+#endif
51
+
}
52
+
53
+
static void amdgpu_move_null(struct ttm_buffer_object *bo,
54
+
diff --git a/amd/display/amdgpu_dm/amdgpu_dm_types.c b/amd/display/amdgpu_dm/amdgpu_dm_types.c
55
+
index be7aafb..5e11f26 100644
56
+
--- a/amd/display/amdgpu_dm/amdgpu_dm_types.c
57
+
+++ b/amd/display/amdgpu_dm/amdgpu_dm_types.c
58
+
@@ -1692,6 +1692,10 @@ static int dm_plane_helper_prepare_fb(
59
+
struct drm_plane *plane,
60
+
struct drm_framebuffer *fb,
61
+
const struct drm_plane_state *new_state)
62
+
+#elif LINUX_VERSION_CODE >= KERNEL_VERSION(4, 9, 0)
63
+
+static int dm_plane_helper_prepare_fb(
64
+
+ struct drm_plane *plane,
65
+
+ struct drm_plane_state *new_state)
66
+
#else
67
+
static int dm_plane_helper_prepare_fb(
68
+
struct drm_plane *plane,
69
+
@@ -1735,6 +1739,10 @@ static void dm_plane_helper_cleanup_fb(
70
+
struct drm_plane *plane,
71
+
struct drm_framebuffer *fb,
72
+
const struct drm_plane_state *old_state)
73
+
+#elif LINUX_VERSION_CODE >= KERNEL_VERSION(4, 9, 0)
74
+
+static void dm_plane_helper_cleanup_fb(
75
+
+ struct drm_plane *plane,
76
+
+ struct drm_plane_state *old_state)
77
+
#else
78
+
static void dm_plane_helper_cleanup_fb(
79
+
struct drm_plane *plane,
80
+
diff --git a/include/kcl/kcl_mm.h b/include/kcl/kcl_mm.h
81
+
index a18936d..f068195 100644
82
+
--- a/include/kcl/kcl_mm.h
83
+
+++ b/include/kcl/kcl_mm.h
84
+
@@ -8,7 +8,9 @@ static inline int kcl_get_user_pages(struct task_struct *tsk, struct mm_struct *
85
+
int write, int force, struct page **pages,
86
+
struct vm_area_struct **vmas)
87
+
{
88
+
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 6, 0)
89
+
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 9, 0)
90
+
+ return get_user_pages(start, nr_pages, write ? FOLL_WRITE : 0, pages, vmas);
91
+
+#elif LINUX_VERSION_CODE >= KERNEL_VERSION(4, 6, 0)
92
+
return get_user_pages(start, nr_pages, write, force, pages, vmas);
93
+
#else
94
+
return get_user_pages(tsk, mm, start, nr_pages,
95
+
--
96
+
2.11.0
97
+
-28
pkgs/os-specific/linux/amdgpu-pro/patches/0003-Remove-extra-parameter-from-ttm_bo_reserve-for-4.7.0.patch
···
1
-
From 999a30883f34c4603c3b747a58a89d4924583769 Mon Sep 17 00:00:00 2001
2
-
From: "Luke A. Guest" <laguest@archeia.com>
3
-
Date: Sun, 25 Sep 2016 15:46:58 +0100
4
-
Subject: [PATCH 03/11] Remove extra parameter from ttm_bo_reserve for 4.7.0
5
-
6
-
---
7
-
amd/backport/include/kcl/kcl_ttm.h | 4 ++++
8
-
1 file changed, 4 insertions(+)
9
-
10
-
diff --git a/amd/backport/include/kcl/kcl_ttm.h b/amd/backport/include/kcl/kcl_ttm.h
11
-
index 6e5a170..52cdbc8 100644
12
-
--- a/amd/backport/include/kcl/kcl_ttm.h
13
-
+++ b/amd/backport/include/kcl/kcl_ttm.h
14
-
@@ -113,7 +113,11 @@ static inline int kcl_ttm_bo_reserve(struct ttm_buffer_object *bo,
15
-
struct ww_acquire_ctx *ticket)
16
-
{
17
-
#if defined(BUILD_AS_DKMS)
18
-
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 7, 0)
19
-
+ return ttm_bo_reserve(bo, interruptible, no_wait, ticket);
20
-
+#else
21
-
return ttm_bo_reserve(bo, interruptible, no_wait, false, ticket);
22
-
+#endif
23
-
#else
24
-
return ttm_bo_reserve(bo, interruptible, no_wait, ticket);
25
-
#endif
26
-
--
27
-
2.11.0
28
-
···
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
+4
-4
pkgs/os-specific/linux/amdgpu-pro/patches/0004-Change-seq_printf-format-for-64-bit-context.patch
pkgs/os-specific/linux/amdgpu-pro/patches/0003-Change-seq_printf-format-for-64-bit-context.patch
···
1
-
From 084b2915e6876d8fdb913938569c0ce7ffef65bc Mon Sep 17 00:00:00 2001
2
From: "Luke A. Guest" <laguest@archeia.com>
3
Date: Sun, 25 Sep 2016 16:46:39 +0100
4
-
Subject: [PATCH 04/11] Change seq_printf format for 64 bit context
5
6
---
7
amd/amdgpu/amdgpu_sa.c | 2 +-
8
1 file changed, 1 insertion(+), 1 deletion(-)
9
10
diff --git a/amd/amdgpu/amdgpu_sa.c b/amd/amdgpu/amdgpu_sa.c
11
-
index 052f745..5886b9a 100644
12
--- a/amd/amdgpu/amdgpu_sa.c
13
+++ b/amd/amdgpu/amdgpu_sa.c
14
-
@@ -428,7 +428,7 @@ void amdgpu_sa_bo_dump_debug_info(struct amdgpu_sa_manager *sa_manager,
15
soffset, eoffset, eoffset - soffset);
16
17
if (i->fence)
···
1
+
From cc490c71a98b6bbe390fcf777fbe0360d01bf4ca Mon Sep 17 00:00:00 2001
2
From: "Luke A. Guest" <laguest@archeia.com>
3
Date: Sun, 25 Sep 2016 16:46:39 +0100
4
+
Subject: [PATCH 3/4] Change seq_printf format for 64 bit context
5
6
---
7
amd/amdgpu/amdgpu_sa.c | 2 +-
8
1 file changed, 1 insertion(+), 1 deletion(-)
9
10
diff --git a/amd/amdgpu/amdgpu_sa.c b/amd/amdgpu/amdgpu_sa.c
11
+
index c43f582..8c4b9f7 100644
12
--- a/amd/amdgpu/amdgpu_sa.c
13
+++ b/amd/amdgpu/amdgpu_sa.c
14
+
@@ -427,7 +427,7 @@ void amdgpu_sa_bo_dump_debug_info(struct amdgpu_sa_manager *sa_manager,
15
soffset, eoffset, eoffset - soffset);
16
17
if (i->fence)
+74
pkgs/os-specific/linux/amdgpu-pro/patches/0004-fix-warnings-for-Werror.patch
···
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
0
0
0
···
1
+
From 9970f3107aed7b2b1ff1c5f29129b62cec99980d 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 4/4] fix warnings for Werror
5
+
6
+
---
7
+
amd/amdgpu/amdgpu_kms.c | 2 +-
8
+
amd/amdgpu/amdgpu_ttm.c | 2 ++
9
+
amd/display/amdgpu_dm/amdgpu_dm.c | 2 +-
10
+
amd/display/amdgpu_dm/amdgpu_dm_types.c | 2 +-
11
+
4 files changed, 5 insertions(+), 3 deletions(-)
12
+
13
+
diff --git a/amd/amdgpu/amdgpu_kms.c b/amd/amdgpu/amdgpu_kms.c
14
+
index b7b51ae..bc884f6 100644
15
+
--- a/amd/amdgpu/amdgpu_kms.c
16
+
+++ b/amd/amdgpu/amdgpu_kms.c
17
+
@@ -591,7 +591,7 @@ static int amdgpu_info_ioctl(struct drm_device *dev, void *data, struct drm_file
18
+
19
+
bios = adev->bios + bios_offset;
20
+
return copy_to_user(out, bios,
21
+
- min((size_t)size, bios_size - bios_offset))
22
+
+ min(size, bios_size - bios_offset))
23
+
? -EFAULT : 0;
24
+
}
25
+
default:
26
+
diff --git a/amd/amdgpu/amdgpu_ttm.c b/amd/amdgpu/amdgpu_ttm.c
27
+
index 252bab4..90f3655 100644
28
+
--- a/amd/amdgpu/amdgpu_ttm.c
29
+
+++ b/amd/amdgpu/amdgpu_ttm.c
30
+
@@ -1083,6 +1083,7 @@ uint32_t amdgpu_ttm_tt_pte_flags(struct amdgpu_device *adev, struct ttm_tt *ttm,
31
+
return flags;
32
+
}
33
+
34
+
+#if 0
35
+
static void amdgpu_ttm_lru_removal(struct ttm_buffer_object *tbo)
36
+
{
37
+
struct amdgpu_device *adev = amdgpu_ttm_adev(tbo->bdev);
38
+
@@ -1132,6 +1133,7 @@ static struct list_head *amdgpu_ttm_swap_lru_tail(struct ttm_buffer_object *tbo)
39
+
40
+
return res;
41
+
}
42
+
+#endif
43
+
44
+
static struct ttm_bo_driver amdgpu_bo_driver = {
45
+
.ttm_tt_create = &amdgpu_ttm_tt_create,
46
+
diff --git a/amd/display/amdgpu_dm/amdgpu_dm.c b/amd/display/amdgpu_dm/amdgpu_dm.c
47
+
index 3dcb619..5700861 100644
48
+
--- a/amd/display/amdgpu_dm/amdgpu_dm.c
49
+
+++ b/amd/display/amdgpu_dm/amdgpu_dm.c
50
+
@@ -121,7 +121,7 @@ static bool dm_check_soft_reset(void *handle)
51
+
52
+
static int dm_soft_reset(void *handle)
53
+
{
54
+
- struct amdgpu_device *adev = (struct amdgpu_device *)handle;
55
+
+ /* struct amdgpu_device *adev = (struct amdgpu_device *)handle; */
56
+
57
+
/* XXX todo */
58
+
return 0;
59
+
diff --git a/amd/display/amdgpu_dm/amdgpu_dm_types.c b/amd/display/amdgpu_dm/amdgpu_dm_types.c
60
+
index 5e11f26..7039542 100644
61
+
--- a/amd/display/amdgpu_dm/amdgpu_dm_types.c
62
+
+++ b/amd/display/amdgpu_dm/amdgpu_dm_types.c
63
+
@@ -913,7 +913,7 @@ static void decide_crtc_timing_for_drm_display_mode(
64
+
}
65
+
66
+
static struct dc_target *create_target_for_sink(
67
+
- const struct amdgpu_connector *aconnector,
68
+
+ struct amdgpu_connector *aconnector,
69
+
const struct drm_display_mode *drm_mode,
70
+
const struct dm_connector_state *dm_state)
71
+
{
72
+
--
73
+
2.11.0
74
+
-136
pkgs/os-specific/linux/amdgpu-pro/patches/0005-Fix-vblank-calls.patch
···
1
-
From 1884ef3a813f3dac0029c7539654ba978635d5d3 Mon Sep 17 00:00:00 2001
2
-
From: "Luke A. Guest" <laguest@archeia.com>
3
-
Date: Sun, 25 Sep 2016 16:49:09 +0100
4
-
Subject: [PATCH 05/11] Fix vblank calls
5
-
6
-
---
7
-
amd/amdgpu/amdgpu_display.c | 8 ++++++++
8
-
amd/amdgpu/dce_v10_0.c | 4 ++++
9
-
amd/amdgpu/dce_v11_0.c | 4 ++++
10
-
amd/amdgpu/dce_v8_0.c | 4 ++++
11
-
amd/amdgpu/dce_virtual.c | 8 ++++++++
12
-
amd/dal/amdgpu_dm/amdgpu_dm.c | 4 ++++
13
-
6 files changed, 32 insertions(+)
14
-
15
-
diff --git a/amd/amdgpu/amdgpu_display.c b/amd/amdgpu/amdgpu_display.c
16
-
index 8425b1d..d6cd383 100644
17
-
--- a/amd/amdgpu/amdgpu_display.c
18
-
+++ b/amd/amdgpu/amdgpu_display.c
19
-
@@ -268,7 +268,11 @@ int amdgpu_crtc_page_flip(struct drm_crtc *crtc,
20
-
21
-
work->base = base;
22
-
23
-
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 8, 0)
24
-
+ r = drm_crtc_vblank_get(crtc);
25
-
+#else
26
-
r = drm_vblank_get(crtc->dev, amdgpu_crtc->crtc_id);
27
-
+#endif
28
-
if (r) {
29
-
DRM_ERROR("failed to get vblank before flip\n");
30
-
goto pflip_cleanup;
31
-
@@ -296,7 +300,11 @@ int amdgpu_crtc_page_flip(struct drm_crtc *crtc,
32
-
return 0;
33
-
34
-
vblank_cleanup:
35
-
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 8, 0)
36
-
+ drm_crtc_vblank_put(&amdgpu_crtc->base);
37
-
+#else
38
-
drm_vblank_put(crtc->dev, amdgpu_crtc->crtc_id);
39
-
+#endif
40
-
41
-
pflip_cleanup:
42
-
if (unlikely(amdgpu_bo_reserve(new_abo, false) != 0)) {
43
-
diff --git a/amd/amdgpu/dce_v10_0.c b/amd/amdgpu/dce_v10_0.c
44
-
index 650d193..b1880ac 100644
45
-
--- a/amd/amdgpu/dce_v10_0.c
46
-
+++ b/amd/amdgpu/dce_v10_0.c
47
-
@@ -3342,7 +3342,11 @@ static int dce_v10_0_pageflip_irq(struct amdgpu_device *adev,
48
-
49
-
spin_unlock_irqrestore(&adev->ddev->event_lock, flags);
50
-
51
-
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 8, 0)
52
-
+ drm_crtc_vblank_put(&amdgpu_crtc->base);
53
-
+#else
54
-
drm_vblank_put(adev->ddev, amdgpu_crtc->crtc_id);
55
-
+#endif
56
-
schedule_work(&works->unpin_work);
57
-
58
-
return 0;
59
-
diff --git a/amd/amdgpu/dce_v11_0.c b/amd/amdgpu/dce_v11_0.c
60
-
index ca03d8e..b654b64 100644
61
-
--- a/amd/amdgpu/dce_v11_0.c
62
-
+++ b/amd/amdgpu/dce_v11_0.c
63
-
@@ -3391,7 +3391,11 @@ static int dce_v11_0_pageflip_irq(struct amdgpu_device *adev,
64
-
65
-
spin_unlock_irqrestore(&adev->ddev->event_lock, flags);
66
-
67
-
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 8, 0)
68
-
+ drm_crtc_vblank_put(&amdgpu_crtc->base);
69
-
+#else
70
-
drm_vblank_put(adev->ddev, amdgpu_crtc->crtc_id);
71
-
+#endif
72
-
schedule_work(&works->unpin_work);
73
-
74
-
return 0;
75
-
diff --git a/amd/amdgpu/dce_v8_0.c b/amd/amdgpu/dce_v8_0.c
76
-
index 8e4dff7..b598caa 100644
77
-
--- a/amd/amdgpu/dce_v8_0.c
78
-
+++ b/amd/amdgpu/dce_v8_0.c
79
-
@@ -3252,7 +3252,11 @@ static int dce_v8_0_pageflip_irq(struct amdgpu_device *adev,
80
-
81
-
spin_unlock_irqrestore(&adev->ddev->event_lock, flags);
82
-
83
-
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 8, 0)
84
-
+ drm_crtc_vblank_put(&amdgpu_crtc->base);
85
-
+#else
86
-
drm_vblank_put(adev->ddev, amdgpu_crtc->crtc_id);
87
-
+#endif
88
-
schedule_work(&works->unpin_work);
89
-
90
-
return 0;
91
-
diff --git a/amd/amdgpu/dce_virtual.c b/amd/amdgpu/dce_virtual.c
92
-
index 0c6e873..36e2094 100644
93
-
--- a/amd/amdgpu/dce_virtual.c
94
-
+++ b/amd/amdgpu/dce_virtual.c
95
-
@@ -746,11 +746,19 @@ static int dce_virtual_pageflip_irq(struct amdgpu_device *adev,
96
-
97
-
/* wakeup usersapce */
98
-
if (works->event)
99
-
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 8, 0)
100
-
+ drm_crtc_send_vblank_event(&amdgpu_crtc->base, works->event);
101
-
+#else
102
-
drm_send_vblank_event(adev->ddev, crtc_id, works->event);
103
-
+#endif
104
-
105
-
spin_unlock_irqrestore(&adev->ddev->event_lock, flags);
106
-
107
-
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 8, 0)
108
-
+ drm_crtc_vblank_put(&amdgpu_crtc->base);
109
-
+#else
110
-
drm_vblank_put(adev->ddev, amdgpu_crtc->crtc_id);
111
-
+#endif
112
-
schedule_work(&works->unpin_work);
113
-
114
-
return 0;
115
-
diff --git a/amd/dal/amdgpu_dm/amdgpu_dm.c b/amd/dal/amdgpu_dm/amdgpu_dm.c
116
-
index c5fcf5a..e9892d8 100644
117
-
--- a/amd/dal/amdgpu_dm/amdgpu_dm.c
118
-
+++ b/amd/dal/amdgpu_dm/amdgpu_dm.c
119
-
@@ -213,10 +213,14 @@ static void dm_pflip_high_irq(void *interrupt_params)
120
-
121
-
/* wakeup usersapce */
122
-
if(works->event)
123
-
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 8, 0)
124
-
+ drm_crtc_send_vblank_event(&amdgpu_crtc->base, works->event);
125
-
+#else
126
-
drm_send_vblank_event(
127
-
adev->ddev,
128
-
amdgpu_crtc->crtc_id,
129
-
works->event);
130
-
+#endif
131
-
132
-
spin_unlock_irqrestore(&adev->ddev->event_lock, flags);
133
-
134
-
--
135
-
2.11.0
136
-
···
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
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
-163
pkgs/os-specific/linux/amdgpu-pro/patches/0006-Fix-crtc_gamma-functions-for-4.8.0.patch
···
1
-
From 12660ae02838f99c0784194908f7a189bc2ab0ae Mon Sep 17 00:00:00 2001
2
-
From: "Luke A. Guest" <laguest@archeia.com>
3
-
Date: Sun, 25 Sep 2016 16:56:47 +0100
4
-
Subject: [PATCH 06/11] Fix crtc_gamma functions for 4.8.0
5
-
6
-
---
7
-
amd/amdgpu/dce_v10_0.c | 19 +++++++++++++++++++
8
-
amd/amdgpu/dce_v11_0.c | 19 +++++++++++++++++++
9
-
amd/amdgpu/dce_v8_0.c | 19 +++++++++++++++++++
10
-
amd/dal/amdgpu_dm/amdgpu_dm_types.c | 12 ++++++++++++
11
-
4 files changed, 69 insertions(+)
12
-
13
-
diff --git a/amd/amdgpu/dce_v10_0.c b/amd/amdgpu/dce_v10_0.c
14
-
index b1880ac..53746fa 100644
15
-
--- a/amd/amdgpu/dce_v10_0.c
16
-
+++ b/amd/amdgpu/dce_v10_0.c
17
-
@@ -2627,6 +2627,24 @@ static void dce_v10_0_cursor_reset(struct drm_crtc *crtc)
18
-
}
19
-
}
20
-
21
-
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 8, 0)
22
-
+static int dce_v10_0_crtc_gamma_set(struct drm_crtc *crtc, u16 *red, u16 *green,
23
-
+ u16 *blue, uint32_t size)
24
-
+{
25
-
+ struct amdgpu_crtc *amdgpu_crtc = to_amdgpu_crtc(crtc);
26
-
+ int i;
27
-
+
28
-
+ /* userspace palettes are always correct as is */
29
-
+ for (i = 0; i < size; i++) {
30
-
+ amdgpu_crtc->lut_r[i] = red[i] >> 6;
31
-
+ amdgpu_crtc->lut_g[i] = green[i] >> 6;
32
-
+ amdgpu_crtc->lut_b[i] = blue[i] >> 6;
33
-
+ }
34
-
+ dce_v10_0_crtc_load_lut(crtc);
35
-
+
36
-
+ return 0;
37
-
+}
38
-
+#else
39
-
static void dce_v10_0_crtc_gamma_set(struct drm_crtc *crtc, u16 *red, u16 *green,
40
-
u16 *blue, uint32_t start, uint32_t size)
41
-
{
42
-
@@ -2641,6 +2659,7 @@ static void dce_v10_0_crtc_gamma_set(struct drm_crtc *crtc, u16 *red, u16 *green
43
-
}
44
-
dce_v10_0_crtc_load_lut(crtc);
45
-
}
46
-
+#endif
47
-
48
-
static void dce_v10_0_crtc_destroy(struct drm_crtc *crtc)
49
-
{
50
-
diff --git a/amd/amdgpu/dce_v11_0.c b/amd/amdgpu/dce_v11_0.c
51
-
index b654b64..3edd66d 100644
52
-
--- a/amd/amdgpu/dce_v11_0.c
53
-
+++ b/amd/amdgpu/dce_v11_0.c
54
-
@@ -2643,6 +2643,24 @@ static void dce_v11_0_cursor_reset(struct drm_crtc *crtc)
55
-
}
56
-
}
57
-
58
-
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 8, 0)
59
-
+static int dce_v11_0_crtc_gamma_set(struct drm_crtc *crtc, u16 *red, u16 *green,
60
-
+ u16 *blue, uint32_t size)
61
-
+{
62
-
+ struct amdgpu_crtc *amdgpu_crtc = to_amdgpu_crtc(crtc);
63
-
+ int i;
64
-
+
65
-
+ /* userspace palettes are always correct as is */
66
-
+ for (i = 0; i < size; i++) {
67
-
+ amdgpu_crtc->lut_r[i] = red[i] >> 6;
68
-
+ amdgpu_crtc->lut_g[i] = green[i] >> 6;
69
-
+ amdgpu_crtc->lut_b[i] = blue[i] >> 6;
70
-
+ }
71
-
+ dce_v11_0_crtc_load_lut(crtc);
72
-
+
73
-
+ return 0;
74
-
+}
75
-
+#else
76
-
static void dce_v11_0_crtc_gamma_set(struct drm_crtc *crtc, u16 *red, u16 *green,
77
-
u16 *blue, uint32_t start, uint32_t size)
78
-
{
79
-
@@ -2657,6 +2675,7 @@ static void dce_v11_0_crtc_gamma_set(struct drm_crtc *crtc, u16 *red, u16 *green
80
-
}
81
-
dce_v11_0_crtc_load_lut(crtc);
82
-
}
83
-
+#endif
84
-
85
-
static void dce_v11_0_crtc_destroy(struct drm_crtc *crtc)
86
-
{
87
-
diff --git a/amd/amdgpu/dce_v8_0.c b/amd/amdgpu/dce_v8_0.c
88
-
index b598caa..d203894 100644
89
-
--- a/amd/amdgpu/dce_v8_0.c
90
-
+++ b/amd/amdgpu/dce_v8_0.c
91
-
@@ -2478,6 +2478,24 @@ static void dce_v8_0_cursor_reset(struct drm_crtc *crtc)
92
-
}
93
-
}
94
-
95
-
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 8, 0)
96
-
+static int dce_v8_0_crtc_gamma_set(struct drm_crtc *crtc, u16 *red, u16 *green,
97
-
+ u16 *blue, uint32_t size)
98
-
+{
99
-
+ struct amdgpu_crtc *amdgpu_crtc = to_amdgpu_crtc(crtc);
100
-
+ int i;
101
-
+
102
-
+ /* userspace palettes are always correct as is */
103
-
+ for (i = 0; i < size; i++) {
104
-
+ amdgpu_crtc->lut_r[i] = red[i] >> 6;
105
-
+ amdgpu_crtc->lut_g[i] = green[i] >> 6;
106
-
+ amdgpu_crtc->lut_b[i] = blue[i] >> 6;
107
-
+ }
108
-
+ dce_v8_0_crtc_load_lut(crtc);
109
-
+
110
-
+ return 0;
111
-
+}
112
-
+#else
113
-
static void dce_v8_0_crtc_gamma_set(struct drm_crtc *crtc, u16 *red, u16 *green,
114
-
u16 *blue, uint32_t start, uint32_t size)
115
-
{
116
-
@@ -2492,6 +2510,7 @@ static void dce_v8_0_crtc_gamma_set(struct drm_crtc *crtc, u16 *red, u16 *green,
117
-
}
118
-
dce_v8_0_crtc_load_lut(crtc);
119
-
}
120
-
+#endif
121
-
122
-
static void dce_v8_0_crtc_destroy(struct drm_crtc *crtc)
123
-
{
124
-
diff --git a/amd/dal/amdgpu_dm/amdgpu_dm_types.c b/amd/dal/amdgpu_dm/amdgpu_dm_types.c
125
-
index edc8e86..32755a9 100644
126
-
--- a/amd/dal/amdgpu_dm/amdgpu_dm_types.c
127
-
+++ b/amd/dal/amdgpu_dm/amdgpu_dm_types.c
128
-
@@ -998,6 +998,13 @@ void amdgpu_dm_crtc_destroy(struct drm_crtc *crtc)
129
-
kfree(crtc);
130
-
}
131
-
132
-
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 8, 0)
133
-
+static int amdgpu_dm_atomic_crtc_gamma_set(struct drm_crtc *crtc,
134
-
+ u16 *red,
135
-
+ u16 *green,
136
-
+ u16 *blue,
137
-
+ uint32_t size)
138
-
+#else
139
-
static void amdgpu_dm_atomic_crtc_gamma_set(
140
-
struct drm_crtc *crtc,
141
-
u16 *red,
142
-
@@ -1005,6 +1012,7 @@ static void amdgpu_dm_atomic_crtc_gamma_set(
143
-
u16 *blue,
144
-
uint32_t start,
145
-
uint32_t size)
146
-
+#endif
147
-
{
148
-
struct drm_device *dev = crtc->dev;
149
-
struct drm_property *prop = dev->mode_config.prop_crtc_id;
150
-
@@ -1012,6 +1020,10 @@ static void amdgpu_dm_atomic_crtc_gamma_set(
151
-
crtc->state->mode.private_flags |= AMDGPU_CRTC_MODE_PRIVATE_FLAGS_GAMMASET;
152
-
153
-
drm_atomic_helper_crtc_set_property(crtc, prop, 0);
154
-
+
155
-
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 8, 0)
156
-
+ return 0;
157
-
+#endif
158
-
}
159
-
160
-
static int dm_crtc_funcs_atomic_set_property(
161
-
--
162
-
2.11.0
163
-
···
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
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
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
-28
pkgs/os-specific/linux/amdgpu-pro/patches/0007-Fix-drm_atomic_helper_swap_state-for-4.8.0.patch
···
1
-
From 7a5d45874b1e2bbbff2d2410f38203b5b0ae67c4 Mon Sep 17 00:00:00 2001
2
-
From: "Luke A. Guest" <laguest@archeia.com>
3
-
Date: Sun, 25 Sep 2016 17:00:32 +0100
4
-
Subject: [PATCH 07/11] Fix drm_atomic_helper_swap_state for 4.8.0
5
-
6
-
---
7
-
amd/dal/amdgpu_dm/amdgpu_dm_types.c | 4 ++++
8
-
1 file changed, 4 insertions(+)
9
-
10
-
diff --git a/amd/dal/amdgpu_dm/amdgpu_dm_types.c b/amd/dal/amdgpu_dm/amdgpu_dm_types.c
11
-
index 32755a9..60ca073 100644
12
-
--- a/amd/dal/amdgpu_dm/amdgpu_dm_types.c
13
-
+++ b/amd/dal/amdgpu_dm/amdgpu_dm_types.c
14
-
@@ -2528,7 +2528,11 @@ int amdgpu_dm_atomic_commit(
15
-
* the software side now.
16
-
*/
17
-
18
-
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 8, 0)
19
-
+ drm_atomic_helper_swap_state(state, true);
20
-
+#else
21
-
drm_atomic_helper_swap_state(dev, state);
22
-
+#endif
23
-
24
-
/*
25
-
* From this point state become old state really. New state is
26
-
--
27
-
2.11.0
28
-
···
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
-40
pkgs/os-specific/linux/amdgpu-pro/patches/0008-Add-extra-flag-to-ttm_bo_move_ttm-for-4.8.0-rc2.patch
···
1
-
From 7c536e8b9f73926014c0622eb101f2cf174b507b Mon Sep 17 00:00:00 2001
2
-
From: "Luke A. Guest" <laguest@archeia.com>
3
-
Date: Sun, 25 Sep 2016 19:19:45 +0100
4
-
Subject: [PATCH 08/11] Add extra flag to ttm_bo_move_ttm for >=4.8.0-rc2
5
-
6
-
---
7
-
amd/amdgpu/amdgpu_ttm.c | 8 ++++++++
8
-
1 file changed, 8 insertions(+)
9
-
10
-
diff --git a/amd/amdgpu/amdgpu_ttm.c b/amd/amdgpu/amdgpu_ttm.c
11
-
index 89760f8..d102224 100644
12
-
--- a/amd/amdgpu/amdgpu_ttm.c
13
-
+++ b/amd/amdgpu/amdgpu_ttm.c
14
-
@@ -428,7 +428,11 @@ static int amdgpu_move_vram_ram(struct ttm_buffer_object *bo,
15
-
if (unlikely(r)) {
16
-
goto out_cleanup;
17
-
}
18
-
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 8, 0)
19
-
+ r = ttm_bo_move_ttm(bo, true, interruptible, no_wait_gpu, new_mem);
20
-
+#else
21
-
r = ttm_bo_move_ttm(bo, true, no_wait_gpu, new_mem);
22
-
+#endif
23
-
out_cleanup:
24
-
ttm_bo_mem_put(bo, &tmp_mem);
25
-
return r;
26
-
@@ -461,7 +465,11 @@ static int amdgpu_move_ram_vram(struct ttm_buffer_object *bo,
27
-
if (unlikely(r)) {
28
-
return r;
29
-
}
30
-
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 8, 0)
31
-
+ r = ttm_bo_move_ttm(bo, true, interruptible, no_wait_gpu, &tmp_mem);
32
-
+#else
33
-
r = ttm_bo_move_ttm(bo, true, no_wait_gpu, &tmp_mem);
34
-
+#endif
35
-
if (unlikely(r)) {
36
-
goto out_cleanup;
37
-
}
38
-
--
39
-
2.11.0
40
-
···
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
-61
pkgs/os-specific/linux/amdgpu-pro/patches/0009-Remove-dependency-on-System.map.patch
···
1
-
From 4d645984264e449d6a4507af033b26daed952eac Mon Sep 17 00:00:00 2001
2
-
From: David McFarland <corngood@gmail.com>
3
-
Date: Wed, 26 Oct 2016 22:26:39 -0300
4
-
Subject: [PATCH 09/11] Remove dependency on System.map
5
-
6
-
---
7
-
amd/backport/Makefile | 1 -
8
-
amd/backport/kcl_fence.c | 10 ++++++++--
9
-
amd/backport/symbols | 7 -------
10
-
3 files changed, 8 insertions(+), 10 deletions(-)
11
-
delete mode 100644 amd/backport/symbols
12
-
13
-
diff --git a/amd/backport/Makefile b/amd/backport/Makefile
14
-
index ff9339d..3f2d9ea 100644
15
-
--- a/amd/backport/Makefile
16
-
+++ b/amd/backport/Makefile
17
-
@@ -64,7 +64,6 @@ ccflags-y += -DOS_NAME_RHEL_7_3
18
-
endif
19
-
endif
20
-
21
-
-BACKPORT_OBJS = symbols.o
22
-
endif
23
-
24
-
BACKPORT_OBJS += kcl_drm.o kcl_ttm.o kcl_amdgpu.o kcl_fence.o kcl_mn.o amdgpu_kcl.o kcl_fence_array.o kcl_kthread.o
25
-
diff --git a/amd/backport/kcl_fence.c b/amd/backport/kcl_fence.c
26
-
index 54ad819..39f6d61 100644
27
-
--- a/amd/backport/kcl_fence.c
28
-
+++ b/amd/backport/kcl_fence.c
29
-
@@ -52,8 +52,14 @@ struct default_wait_cb {
30
-
struct task_struct *task;
31
-
};
32
-
33
-
-extern void
34
-
-(*fence_default_wait_cb)(struct fence *fence, struct fence_cb *cb);
35
-
+static void
36
-
+fence_default_wait_cb(struct fence *fence, struct fence_cb *cb)
37
-
+{
38
-
+ struct default_wait_cb *wait =
39
-
+ container_of(cb, struct default_wait_cb, base);
40
-
+
41
-
+ wake_up_process(wait->task);
42
-
+}
43
-
44
-
signed long
45
-
_kcl_fence_wait_any_timeout(struct fence **fences, uint32_t count,
46
-
diff --git a/amd/backport/symbols b/amd/backport/symbols
47
-
deleted file mode 100644
48
-
index 68cae63..0000000
49
-
--- a/amd/backport/symbols
50
-
+++ /dev/null
51
-
@@ -1,7 +0,0 @@
52
-
-SYMS=""
53
-
-
54
-
-SYMS+="fence_default_wait_cb"
55
-
-
56
-
-if version_lt 2.6.33; then
57
-
- SYMS+=" kallsyms_lookup_name"
58
-
-fi
59
-
--
60
-
2.11.0
61
-
···
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/0010-disable-dal-by-default.patch
···
1
-
From 5ab8e5e36634391a5c440bf78463226b2074485e Mon Sep 17 00:00:00 2001
2
-
From: David McFarland <corngood@gmail.com>
3
-
Date: Thu, 25 Aug 2016 22:17:06 -0300
4
-
Subject: [PATCH 10/11] disable dal by default
5
-
6
-
---
7
-
amd/amdgpu/amdgpu_drv.c | 2 +-
8
-
1 file changed, 1 insertion(+), 1 deletion(-)
9
-
10
-
diff --git a/amd/amdgpu/amdgpu_drv.c b/amd/amdgpu/amdgpu_drv.c
11
-
index d6b3f35..4477865 100755
12
-
--- a/amd/amdgpu/amdgpu_drv.c
13
-
+++ b/amd/amdgpu/amdgpu_drv.c
14
-
@@ -88,7 +88,7 @@ int amdgpu_vm_fault_stop = 0;
15
-
int amdgpu_vm_debug = 0;
16
-
int amdgpu_vram_page_split = -1;
17
-
int amdgpu_exp_hw_support = 0;
18
-
-int amdgpu_dal = -1;
19
-
+int amdgpu_dal = 0;
20
-
int amdgpu_sched_jobs = 32;
21
-
int amdgpu_sched_hw_submission = 2;
22
-
int amdgpu_powerplay = -1;
23
-
--
24
-
2.11.0
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
-114
pkgs/os-specific/linux/amdgpu-pro/patches/0011-kcl-fixes-for-16.50-linux-4.8.patch
···
1
-
From 156445f6eda047ee5a5d6e4bde36c3e9ccbbd7d9 Mon Sep 17 00:00:00 2001
2
-
From: David McFarland <corngood@gmail.com>
3
-
Date: Thu, 29 Dec 2016 14:20:06 -0400
4
-
Subject: [PATCH 11/11] kcl fixes for 16.50 + linux-4.8
5
-
6
-
---
7
-
amd/amdgpu/dce_v6_0.c | 5 +++--
8
-
amd/amdgpu/dce_virtual.c | 5 +++--
9
-
amd/backport/include/kcl/kcl_drm.h | 12 ++++++++++++
10
-
amd/backport/include/kcl/kcl_ttm.h | 2 +-
11
-
amd/backport/kcl_drm.c | 4 ++++
12
-
5 files changed, 23 insertions(+), 5 deletions(-)
13
-
14
-
diff --git a/amd/amdgpu/dce_v6_0.c b/amd/amdgpu/dce_v6_0.c
15
-
index fd3eeb0..1f1874c 100644
16
-
--- a/amd/amdgpu/dce_v6_0.c
17
-
+++ b/amd/amdgpu/dce_v6_0.c
18
-
@@ -1946,9 +1946,9 @@ static void dce_v6_0_cursor_reset(struct drm_crtc *crtc)
19
-
}
20
-
}
21
-
22
-
-static void dce_v6_0_crtc_gamma_set(struct drm_crtc *crtc, u16 *red, u16 *green,
23
-
- u16 *blue, uint32_t start, uint32_t size)
24
-
+static kcl_crtc_gamma_set_callback(dce_v6_0_crtc_gamma_set)
25
-
{
26
-
+ kcl_crtc_gamma_set_pre
27
-
struct amdgpu_crtc *amdgpu_crtc = to_amdgpu_crtc(crtc);
28
-
int end = (start + size > 256) ? 256 : start + size, i;
29
-
30
-
@@ -1959,6 +1959,7 @@ static void dce_v6_0_crtc_gamma_set(struct drm_crtc *crtc, u16 *red, u16 *green,
31
-
amdgpu_crtc->lut_b[i] = blue[i] >> 6;
32
-
}
33
-
dce_v6_0_crtc_load_lut(crtc);
34
-
+ kcl_crtc_gamma_set_suf
35
-
}
36
-
37
-
static void dce_v6_0_crtc_destroy(struct drm_crtc *crtc)
38
-
diff --git a/amd/amdgpu/dce_virtual.c b/amd/amdgpu/dce_virtual.c
39
-
index 36e2094..11b98e2 100644
40
-
--- a/amd/amdgpu/dce_virtual.c
41
-
+++ b/amd/amdgpu/dce_virtual.c
42
-
@@ -152,9 +152,9 @@ static void dce_virtual_bandwidth_update(struct amdgpu_device *adev)
43
-
return;
44
-
}
45
-
46
-
-static void dce_virtual_crtc_gamma_set(struct drm_crtc *crtc, u16 *red, u16 *green,
47
-
- u16 *blue, uint32_t start, uint32_t size)
48
-
+static kcl_crtc_gamma_set_callback(dce_virtual_crtc_gamma_set)
49
-
{
50
-
+ kcl_crtc_gamma_set_pre
51
-
struct amdgpu_crtc *amdgpu_crtc = to_amdgpu_crtc(crtc);
52
-
int end = (start + size > 256) ? 256 : start + size, i;
53
-
54
-
@@ -164,6 +164,7 @@ static void dce_virtual_crtc_gamma_set(struct drm_crtc *crtc, u16 *red, u16 *gre
55
-
amdgpu_crtc->lut_g[i] = green[i] >> 6;
56
-
amdgpu_crtc->lut_b[i] = blue[i] >> 6;
57
-
}
58
-
+ kcl_crtc_gamma_set_suf
59
-
}
60
-
61
-
static void dce_virtual_crtc_destroy(struct drm_crtc *crtc)
62
-
diff --git a/amd/backport/include/kcl/kcl_drm.h b/amd/backport/include/kcl/kcl_drm.h
63
-
index 95bf640..61c38b1 100644
64
-
--- a/amd/backport/include/kcl/kcl_drm.h
65
-
+++ b/amd/backport/include/kcl/kcl_drm.h
66
-
@@ -206,4 +206,16 @@ int drm_atomic_helper_resume(struct drm_device *dev,
67
-
68
-
#endif
69
-
70
-
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 8, 0)
71
-
+#define kcl_crtc_gamma_set_callback(n) int n(struct drm_crtc *crtc, \
72
-
+ u16 *red, u16 *green, u16 *blue, uint32_t size)
73
-
+#define kcl_crtc_gamma_set_pre uint32_t start = 0;
74
-
+#define kcl_crtc_gamma_set_suf return 0;
75
-
+#else
76
-
+#define kcl_crtc_gamma_set_callback(n) void n(struct drm_crtc *crtc, \
77
-
+ u16 *red, u16 *green, u16 *blue, uint32_t start, uint32_t size)
78
-
+#define kcl_crtc_gamma_set_pre
79
-
+#define kcl_crtc_gamma_set_suf
80
-
+#endif
81
-
+
82
-
#endif /* AMDGPU_BACKPORT_KCL_DRM_H */
83
-
diff --git a/amd/backport/include/kcl/kcl_ttm.h b/amd/backport/include/kcl/kcl_ttm.h
84
-
index 52cdbc8..cdda0b5 100644
85
-
--- a/amd/backport/include/kcl/kcl_ttm.h
86
-
+++ b/amd/backport/include/kcl/kcl_ttm.h
87
-
@@ -152,7 +152,7 @@ static inline int kcl_ttm_bo_move_accel_cleanup(struct ttm_buffer_object *bo,
88
-
bool evict, bool no_wait_gpu,
89
-
struct ttm_mem_reg *new_mem)
90
-
{
91
-
-#if defined(BUILD_AS_DKMS)
92
-
+#if defined(BUILD_AS_DKMS) && (LINUX_VERSION_CODE < KERNEL_VERSION(4, 8, 0))
93
-
return ttm_bo_move_accel_cleanup(bo, fence,
94
-
evict, no_wait_gpu, new_mem);
95
-
#else
96
-
diff --git a/amd/backport/kcl_drm.c b/amd/backport/kcl_drm.c
97
-
index 27d4aaa..a083c87 100644
98
-
--- a/amd/backport/kcl_drm.c
99
-
+++ b/amd/backport/kcl_drm.c
100
-
@@ -178,7 +178,11 @@ static inline struct drm_plane_state *
101
-
_kcl_drm_atomic_get_existing_plane_state(struct drm_atomic_state *state,
102
-
struct drm_plane *plane)
103
-
{
104
-
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 8, 0)
105
-
+ return drm_atomic_get_existing_plane_state(state, plane);
106
-
+#else
107
-
return state->plane_states[drm_plane_index(plane)];
108
-
+#endif
109
-
}
110
-
111
-
void
112
-
--
113
-
2.11.0
114
-
···
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
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
-55
pkgs/os-specific/linux/amdgpu-pro/patches/0012-use-kernel-fence_array-in-4.8.patch
···
1
-
From 73e77e056427e2042b8d84933c02db92e17cf233 Mon Sep 17 00:00:00 2001
2
-
From: David McFarland <corngood@gmail.com>
3
-
Date: Thu, 29 Dec 2016 14:49:18 -0400
4
-
Subject: [PATCH] use kernel fence_array in 4.8+
5
-
6
-
---
7
-
amd/backport/include/kcl/kcl_fence_array.h | 10 ++++++++--
8
-
amd/backport/kcl_fence_array.c | 2 +-
9
-
2 files changed, 9 insertions(+), 3 deletions(-)
10
-
11
-
diff --git a/amd/backport/include/kcl/kcl_fence_array.h b/amd/backport/include/kcl/kcl_fence_array.h
12
-
index bb4401e..0d9f344 100644
13
-
--- a/amd/backport/include/kcl/kcl_fence_array.h
14
-
+++ b/amd/backport/include/kcl/kcl_fence_array.h
15
-
@@ -19,11 +19,15 @@
16
-
* more details.
17
-
*/
18
-
19
-
-#ifndef __LINUX_FENCE_ARRAY_H
20
-
-#define __LINUX_FENCE_ARRAY_H
21
-
+#ifndef __KCL_FENCE_ARRAY_H
22
-
+#define __KCL_FENCE_ARRAY_H
23
-
24
-
#include <linux/fence.h>
25
-
26
-
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,8,0)
27
-
+#include <linux/fence-array.h>
28
-
+#else
29
-
+
30
-
/**
31
-
* struct fence_array_cb - callback helper for fence array
32
-
* @cb: fence callback structure for signaling
33
-
@@ -72,4 +76,6 @@ struct fence_array *fence_array_create(int num_fences, struct fence **fences,
34
-
u64 context, unsigned seqno,
35
-
bool signal_on_any);
36
-
37
-
+#endif
38
-
+
39
-
#endif /* __LINUX_FENCE_ARRAY_H */
40
-
diff --git a/amd/backport/kcl_fence_array.c b/amd/backport/kcl_fence_array.c
41
-
index d7ee15c..1865444 100644
42
-
--- a/amd/backport/kcl_fence_array.c
43
-
+++ b/amd/backport/kcl_fence_array.c
44
-
@@ -21,7 +21,7 @@
45
-
#include <linux/export.h>
46
-
#include <linux/slab.h>
47
-
48
-
-#if defined(BUILD_AS_DKMS)
49
-
+#if defined(BUILD_AS_DKMS) && LINUX_VERSION_CODE < KERNEL_VERSION(4,8,0)
50
-
static void fence_array_cb_func(struct fence *f, struct fence_cb *cb);
51
-
52
-
static const char *fence_array_get_driver_name(struct fence *fence)
53
-
--
54
-
2.11.0
55
-
···
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
+14
-4
pkgs/servers/x11/xorg/overrides.nix
···
398
};
399
400
xorgserver = with xorg; attrs_passed:
401
-
# exchange attrs if fglrxCompat is set
402
let
403
-
attrs = if !args.fglrxCompat then attrs_passed else
404
-
with args; {
0
405
name = "xorg-server-1.17.4";
406
builder = ./builder.sh;
407
src = fetchurl {
···
410
};
411
buildInputs = [pkgconfig dri2proto dri3proto renderproto libdrm openssl libX11 libXau libXaw libxcb xcbutil xcbutilwm xcbutilimage xcbutilkeysyms xcbutilrenderutil libXdmcp libXfixes libxkbfile libXmu libXpm libXrender libXres libXt ];
412
meta.platforms = stdenv.lib.platforms.unix;
413
-
};
0
0
0
0
0
0
0
0
0
414
415
in attrs //
416
(let
···
398
};
399
400
xorgserver = with xorg; attrs_passed:
401
+
# exchange attrs if abiCompat is set
402
let
403
+
attrs = with args;
404
+
if (args.abiCompat == null) then attrs_passed
405
+
else if (args.abiCompat == "1.17") then {
406
name = "xorg-server-1.17.4";
407
builder = ./builder.sh;
408
src = fetchurl {
···
411
};
412
buildInputs = [pkgconfig dri2proto dri3proto renderproto libdrm openssl libX11 libXau libXaw libxcb xcbutil xcbutilwm xcbutilimage xcbutilkeysyms xcbutilrenderutil libXdmcp libXfixes libxkbfile libXmu libXpm libXrender libXres libXt ];
413
meta.platforms = stdenv.lib.platforms.unix;
414
+
} else if (args.abiCompat == "1.18") then {
415
+
name = "xorg-server-1.18.4";
416
+
builder = ./builder.sh;
417
+
src = fetchurl {
418
+
url = mirror://xorg/individual/xserver/xorg-server-1.18.4.tar.bz2;
419
+
sha256 = "1j1i3n5xy1wawhk95kxqdc54h34kg7xp4nnramba2q8xqfr5k117";
420
+
};
421
+
buildInputs = [pkgconfig dri2proto dri3proto renderproto libdrm openssl libX11 libXau libXaw libxcb xcbutil xcbutilwm xcbutilimage xcbutilkeysyms xcbutilrenderutil libXdmcp libXfixes libxkbfile libXmu libXpm libXrender libXres libXt ];
422
+
meta.platforms = stdenv.lib.platforms.unix;
423
+
} else throw "unsupported xorg abiCompat: ${args.abiCompat}";
424
425
in attrs //
426
(let
+1
-1
pkgs/top-level/all-packages.nix
···
10798
python = python2; # Incompatible with Python 3x
10799
udev = if stdenv.isLinux then udev else null;
10800
libdrm = if stdenv.isLinux then libdrm else null;
10801
-
fglrxCompat = config.xorg.fglrxCompat or false; # `config` because we have no `xorg.override`
10802
} // { inherit xlibsWrapper; } );
10803
10804
xwayland = callPackage ../servers/x11/xorg/xwayland.nix { };
···
10798
python = python2; # Incompatible with Python 3x
10799
udev = if stdenv.isLinux then udev else null;
10800
libdrm = if stdenv.isLinux then libdrm else null;
10801
+
abiCompat = config.xorg.abiCompat or null; # `config` because we have no `xorg.override`
10802
} // { inherit xlibsWrapper; } );
10803
10804
xwayland = callPackage ../servers/x11/xorg/xwayland.nix { };