tangled
alpha
login
or
join now
pyrox.dev
/
nixpkgs
lol
0
fork
atom
overview
issues
pulls
pipelines
amdgpu-pro: 16.60 -> 17.10
David McFarland
8 years ago
cfaad267
58de703c
+40
-115
5 changed files
expand all
collapse all
unified
split
pkgs
os-specific
linux
amdgpu-pro
default.nix
patches
0001-disable-firmware-copy.patch
0002-linux-4.9-fixes.patch
0003-Change-seq_printf-format-for-64-bit-context.patch
0004-fix-warnings-for-Werror.patch
+3
-3
pkgs/os-specific/linux/amdgpu-pro/default.nix
···
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
···
30
31
in stdenv.mkDerivation rec {
32
33
+
version = "17.10";
34
pname = "amdgpu-pro";
35
+
build = "${version}-401251";
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 = "004n0df8acjpjz72z3bjxb2a0b7qwln13jlknfn7xxqvhhwwy40a";
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
+5
-5
pkgs/os-specific/linux/amdgpu-pro/patches/0001-disable-firmware-copy.patch
···
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
···
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 {} + \
···
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
···
1
+
From 704cef8638ffbdd8de9e57f28b43ea42c685ea87 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
···
8
1 file changed, 5 deletions(-)
9
10
diff --git a/pre-build.sh b/pre-build.sh
11
+
index 622ff13..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 {} + \
···
18
-
19
-FW_DIR="/lib/firmware/$KERNELVER"
20
-mkdir -p $FW_DIR
21
+
-cp -ar /usr/src/amdgpu-pro-17.10-401251/firmware/radeon $FW_DIR
22
+
-cp -ar /usr/src/amdgpu-pro-17.10-401251/firmware/amdgpu $FW_DIR
23
--
24
+
2.12.2
25
+19
-66
pkgs/os-specific/linux/amdgpu-pro/patches/0002-linux-4.9-fixes.patch
···
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(
0
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(
···
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(
0
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(
···
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
···
1
+
From 0ead7017e1db18be971c24c891d4bdcc507deea7 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/amdkcl/kcl_io.c | 2 ++
0
8
amd/display/amdgpu_dm/amdgpu_dm_types.c | 8 ++++++++
9
+
2 files changed, 10 insertions(+)
0
10
11
+
diff --git a/amd/amdkcl/kcl_io.c b/amd/amdkcl/kcl_io.c
12
+
index d8f843f..9a1bd9b 100644
13
+
--- a/amd/amdkcl/kcl_io.c
14
+
+++ b/amd/amdkcl/kcl_io.c
15
+
@@ -31,4 +31,6 @@ void amdkcl_io_init(void)
16
+
_kcl_io_free_memtype = amdkcl_fp_setup("io_free_memtype", NULL);
17
+
}
18
+
#endif
0
0
19
+#else
20
+
+void amdkcl_io_init(void) {}
21
+
#endif /* LINUX_VERSION_CODE < KERNEL_VERSION(4, 9, 0) */
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
22
diff --git a/amd/display/amdgpu_dm/amdgpu_dm_types.c b/amd/display/amdgpu_dm/amdgpu_dm_types.c
23
+
index 34313a9..44a4a71 100644
24
--- a/amd/display/amdgpu_dm/amdgpu_dm_types.c
25
+++ b/amd/display/amdgpu_dm/amdgpu_dm_types.c
26
+
@@ -1720,6 +1720,10 @@ static int dm_plane_helper_prepare_fb(
27
+
static int dm_plane_helper_prepare_fb(
28
struct drm_plane *plane,
0
29
const struct drm_plane_state *new_state)
30
+#elif LINUX_VERSION_CODE >= KERNEL_VERSION(4, 9, 0)
31
+static int dm_plane_helper_prepare_fb(
···
34
#else
35
static int dm_plane_helper_prepare_fb(
36
struct drm_plane *plane,
37
+
@@ -1766,6 +1770,10 @@ static void dm_plane_helper_cleanup_fb(
38
+
static void dm_plane_helper_cleanup_fb(
39
struct drm_plane *plane,
0
40
const struct drm_plane_state *old_state)
41
+#elif LINUX_VERSION_CODE >= KERNEL_VERSION(4, 9, 0)
42
+static void dm_plane_helper_cleanup_fb(
···
45
#else
46
static void dm_plane_helper_cleanup_fb(
47
struct drm_plane *plane,
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
48
--
49
+
2.12.2
50
+5
-5
pkgs/os-specific/linux/amdgpu-pro/patches/0003-Change-seq_printf-format-for-64-bit-context.patch
···
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
···
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)
18
-#if defined(BUILD_AS_DKMS)
19
+#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 8, 0)
20
seq_printf(m, " protected by 0x%08x on context %d",
21
-
i->fence->seqno, i->fence->context);
22
#else
23
--
24
-
2.11.0
25
···
1
+
From b6dd36dd90c5d88ae10b9dbc763d3bacb95ccddb 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
···
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 74932bf..db4119a 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)
18
-#if defined(BUILD_AS_DKMS)
19
+#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 8, 0)
20
seq_printf(m, " protected by 0x%08x on context %d",
21
+
i->fence->seqno, i->fence->context);
22
#else
23
--
24
+
2.12.2
25
+8
-36
pkgs/os-specific/linux/amdgpu-pro/patches/0004-fix-warnings-for-Werror.patch
···
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,
···
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(
···
70
const struct dm_connector_state *dm_state)
71
{
72
--
73
-
2.11.0
74
···
1
+
From dbf01d3934c52acaaa37f008859f69c5edf19ad5 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
---
0
7
amd/amdgpu/amdgpu_ttm.c | 2 ++
0
8
amd/display/amdgpu_dm/amdgpu_dm_types.c | 2 +-
9
+
2 files changed, 3 insertions(+), 1 deletion(-)
10
0
0
0
0
0
0
0
0
0
0
0
0
0
11
diff --git a/amd/amdgpu/amdgpu_ttm.c b/amd/amdgpu/amdgpu_ttm.c
12
+
index 0e30389..890aafa 100644
13
--- a/amd/amdgpu/amdgpu_ttm.c
14
+++ b/amd/amdgpu/amdgpu_ttm.c
15
@@ -1083,6 +1083,7 @@ uint32_t amdgpu_ttm_tt_pte_flags(struct amdgpu_device *adev, struct ttm_tt *ttm,
···
26
}
27
+#endif
28
29
+
static bool amdgpu_ttm_bo_eviction_valuable(struct ttm_buffer_object *bo,
30
+
const struct ttm_place *place)
0
0
0
0
0
0
0
0
0
0
0
0
0
31
diff --git a/amd/display/amdgpu_dm/amdgpu_dm_types.c b/amd/display/amdgpu_dm/amdgpu_dm_types.c
32
+
index 44a4a71..ae7e707 100644
33
--- a/amd/display/amdgpu_dm/amdgpu_dm_types.c
34
+++ b/amd/display/amdgpu_dm/amdgpu_dm_types.c
35
+
@@ -932,7 +932,7 @@ static void decide_crtc_timing_for_drm_display_mode(
36
}
37
38
static struct dc_target *create_target_for_sink(
···
42
const struct dm_connector_state *dm_state)
43
{
44
--
45
+
2.12.2
46