Gentoo Archives: gentoo-commits

From: Emil Karlson <jekarlson@×××××.com>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/x11:master commit in: x11-drivers/ati-drivers/, x11-drivers/ati-drivers/files/
Date: Tue, 08 Dec 2015 11:19:49
Message-Id: 1449573230.8dd557ff4303226a49aecb544c8e8d0594b91c99.emil_karlson@gentoo
1 commit: 8dd557ff4303226a49aecb544c8e8d0594b91c99
2 Author: Emil Karlson <jekarlson <AT> gmail <DOT> com>
3 AuthorDate: Tue Dec 8 11:13:50 2015 +0000
4 Commit: Emil Karlson <jekarlson <AT> gmail <DOT> com>
5 CommitDate: Tue Dec 8 11:13:50 2015 +0000
6 URL: https://gitweb.gentoo.org/proj/x11.git/commit/?id=8dd557ff
7
8 x11-drivers/ati-drivers: version bump
9
10 Thanks to Rion for comtributed patch
11
12 ...s-14.2_beta.ebuild => ati-drivers-15.11.ebuild} | 109 +++++++++++----------
13 .../ati-drivers-15.11-remove-gpl-symbols.patch | 48 +++++++++
14 x11-drivers/ati-drivers/files/atieventsd.service | 9 ++
15 3 files changed, 112 insertions(+), 54 deletions(-)
16
17 diff --git a/x11-drivers/ati-drivers/ati-drivers-14.2_beta.ebuild b/x11-drivers/ati-drivers/ati-drivers-15.11.ebuild
18 similarity index 90%
19 rename from x11-drivers/ati-drivers/ati-drivers-14.2_beta.ebuild
20 rename to x11-drivers/ati-drivers/ati-drivers-15.11.ebuild
21 index bfd9728..e38c540 100644
22 --- a/x11-drivers/ati-drivers/ati-drivers-14.2_beta.ebuild
23 +++ b/x11-drivers/ati-drivers/ati-drivers-15.11.ebuild
24 @@ -4,19 +4,20 @@
25
26 EAPI=5
27
28 -inherit eutils multilib linux-info linux-mod toolchain-funcs versionator pax-utils
29 +MULTILIB_COMPAT=( abi_x86_{32,64} )
30 +inherit eutils multilib-build linux-info linux-mod systemd toolchain-funcs versionator pax-utils
31
32 DESCRIPTION="Ati precompiled drivers for Radeon Evergreen (HD5000 Series) and newer chipsets"
33 HOMEPAGE="http://www.amd.com"
34 -RUN="${WORKDIR}/amd-driver-installer-13.35.1005-x86.x86_64.run"
35 +RUN="${WORKDIR}/fglrx-15.30.1025/amd-driver-installer-15.30.1025-x86.x86_64.run"
36 SLOT="1"
37 # Uses javascript for download YESSSS
38 #DRIVERS_URI="http://www2.ati.com/drivers/linux/amd-catalyst-13.12-linux-x86.x86_64.zip"
39 -DRIVERS_URI="http://dev.gentooexperimental.org/~scarabeus/amd-catalyst-14.2-betav1.3-linux-x86.x86_64.zip"
40 +DRIVERS_URI="mirror://gentoo/radeon-crimson-15.11-15.30.1025.zip"
41 XVBA_SDK_URI="http://developer.amd.com/wordpress/media/2012/10/xvba-sdk-0.74-404001.tar.gz"
42 SRC_URI="${DRIVERS_URI} ${XVBA_SDK_URI}"
43 FOLDER_PREFIX="common/"
44 -IUSE="debug +modules multilib qt4 static-libs pax_kernel"
45 +IUSE="debug +modules qt4 static-libs pax_kernel gdm-hack"
46
47 LICENSE="AMD GPL-2 QPL-1.0"
48 KEYWORDS="-* ~amd64 ~x86"
49 @@ -24,30 +25,18 @@ KEYWORDS="-* ~amd64 ~x86"
50 RESTRICT="bindist test"
51
52 RDEPEND="
53 - <=x11-base/xorg-server-1.15.49[-minimal]
54 + <=x11-base/xorg-server-1.17.49[-minimal]
55 >=app-eselect/eselect-opengl-1.0.7
56 app-eselect/eselect-opencl
57 sys-power/acpid
58 x11-apps/xauth
59 - x11-libs/libX11
60 - x11-libs/libXext
61 - x11-libs/libXinerama
62 - x11-libs/libXrandr
63 - x11-libs/libXrender
64 - virtual/glu
65 - multilib? (
66 - app-emulation/emul-linux-x86-opengl
67 - || (
68 - (
69 - x11-libs/libX11[abi_x86_32]
70 - x11-libs/libXext[abi_x86_32]
71 - x11-libs/libXinerama[abi_x86_32]
72 - x11-libs/libXrandr[abi_x86_32]
73 - x11-libs/libXrender[abi_x86_32]
74 - )
75 - app-emulation/emul-linux-x86-xlibs
76 - )
77 - )
78 + !x11-libs/xvba-video
79 + virtual/glu[${MULTILIB_USEDEP}]
80 + x11-libs/libX11[${MULTILIB_USEDEP}]
81 + x11-libs/libXext[${MULTILIB_USEDEP}]
82 + x11-libs/libXinerama[${MULTILIB_USEDEP}]
83 + x11-libs/libXrandr[${MULTILIB_USEDEP}]
84 + x11-libs/libXrender[${MULTILIB_USEDEP}]
85 qt4? (
86 x11-libs/libICE
87 x11-libs/libSM
88 @@ -57,6 +46,9 @@ RDEPEND="
89 dev-qt/qtcore:4
90 dev-qt/qtgui:4[accessibility]
91 )
92 + gdm-hack? (
93 + x11-base/xorg-server:=
94 + )
95 "
96 if [[ legacy != ${SLOT} ]]; then
97 RDEPEND="${RDEPEND}
98 @@ -120,6 +112,7 @@ QA_SONAME="
99 usr/lib\(32\|64\)\?/libaticaldd.so
100 usr/lib\(32\|64\)\?/libaticalrt.so
101 usr/lib\(32\|64\)\?/libamdocl\(32\|64\)\?.so
102 + usr/lib\(32\|64\)\?/libamdhsasc\(32\|64\)\?.so
103 "
104
105 QA_DT_HASH="
106 @@ -152,6 +145,14 @@ QA_DT_HASH="
107 usr/lib\(32\|64\)\?/OpenCL/vendors/amd/libOpenCL.so.1
108 "
109
110 +pkg_nofetch() {
111 + einfo "The driver packages"
112 + einfo ${A}
113 + einfo "need to be downloaded manually from"
114 + einfo "http://support.amd.com/en-us/download/desktop?os=Linux%20x86_64"
115 + einfo "and ${XVBA_SDK_URI}"
116 +}
117 +
118 pkg_pretend() {
119 local CONFIG_CHECK="~MTRR ~!DRM ACPI PCI_MSI !LOCKDEP !PAX_KERNEXEC_PLUGIN_METHOD_OR"
120 use amd64 && CONFIG_CHECK+=" COMPAT"
121 @@ -193,7 +194,7 @@ pkg_setup() {
122 MODULE_NAMES="fglrx(video:${S}/${FOLDER_PREFIX}/lib/modules/fglrx/build_mod/2.6.x)"
123 BUILD_TARGETS="kmod_build"
124 linux-mod_pkg_setup
125 - BUILD_PARAMS="GCC_VER_MAJ=$(gcc-major-version) KVER=${KV_FULL} KDIR=${KV_DIR}"
126 + BUILD_PARAMS="GCC_VER_MAJ=$(gcc-major-version) KVER=${KV_FULL} KDIR=${KV_OUT_DIR}"
127 BUILD_PARAMS="${BUILD_PARAMS} CFLAGS_MODULE+=\"-DMODULE -DATI -DFGL\""
128 if grep -q arch_compat_alloc_user_space ${KV_DIR}/arch/x86/include/asm/compat.h ; then
129 BUILD_PARAMS="${BUILD_PARAMS} CFLAGS_MODULE+=-DCOMPAT_ALLOC_USER_SPACE=arch_compat_alloc_user_space"
130 @@ -224,7 +225,7 @@ pkg_setup() {
131 elog
132 elog "If your card is older then use ${CATEGORY}/xf86-video-ati"
133 elog "For migration informations please refer to:"
134 - elog "http://www.gentoo.org/proj/en/desktop/x/x11/ati-migration-guide.xml"
135 + elog "https://www.gentoo.org/proj/en/desktop/x/x11/ati-migration-guide.xml"
136 einfo
137 }
138
139 @@ -235,6 +236,8 @@ src_unpack() {
140
141 if [[ ${DRIVERS_DISTFILE} =~ .*\.tar\.gz ]]; then
142 unpack ${DRIVERS_DISTFILE}
143 + mkdir -p common
144 + mv etc lib usr common || die "Assumed to find etc lib and usr for common"
145 else
146 #please note, RUN may be insanely assigned at top near SRC_URI
147 if [[ ${DRIVERS_DISTFILE} =~ .*\.zip ]]; then
148 @@ -296,25 +299,18 @@ src_prepare() {
149 # compile fix for AGP-less kernel, bug #435322
150 epatch "${FILESDIR}"/ati-drivers-12.9-KCL_AGP_FindCapsRegisters-stub.patch
151
152 - # Compile fix for kernel typesafe uid types #469160
153 - epatch "${FILESDIR}/typesafe-kuid.diff"
154 -
155 epatch "${FILESDIR}/ati-drivers-13.8-beta-include-seq_file.patch"
156
157 - epatch "${FILESDIR}/check-for-iommu-only-if-iommu-is-supported.patch"
158 -
159 # Fix #483400
160 epatch "${FILESDIR}/fgl_glxgears-do-not-include-glATI.patch"
161
162 - # Fix build on new kernels
163 - #epatch "${FILESDIR}/ati-drivers-13.12-acpi.patch"
164 -
165 - # Add support for linux-3.13. See #498766
166 - #epatch "${FILESDIR}/ati-drivers-linux-3.13-acpi-handle.patch"
167 + epatch "${FILESDIR}/ati-drivers-15.11-remove-gpl-symbols.patch"
168
169 # Compile fix, https://bugs.gentoo.org/show_bug.cgi?id=454870
170 use pax_kernel && epatch "${FILESDIR}/const-notifier-block.patch"
171
172 + epatch_user
173 +
174 cd "${MODULE_DIR}"
175
176 # bugged fglrx build system, this file should be copied by hand
177 @@ -382,21 +378,7 @@ src_install() {
178 # amd64 are installed in src_install-libs. Everything else
179 # (including libraries only available in native 64bit on amd64)
180 # goes in here.
181 -
182 - # There used to be some code here that tried to detect running
183 - # under a "native multilib" portage ((precursor of)
184 - # http://dev.gentoo.org/~kanaka/auto-multilib/). I removed that, it
185 - # should just work (only doing some duplicate work). --marienz
186 - if has_multilib_profile; then
187 - local OABI=${ABI}
188 - for ABI in $(get_install_abis); do
189 - src_install-libs
190 - done
191 - ABI=${OABI}
192 - unset OABI
193 - else
194 - src_install-libs
195 - fi
196 + multilib_foreach_abi src_install-libs
197
198 # This is sorted by the order the files occur in the source tree.
199
200 @@ -408,6 +390,11 @@ src_install() {
201 exeinto /usr/$(get_libdir)/xorg/modules
202 doexe "${MY_BASE_DIR}"/usr/X11R6/${PKG_LIBDIR}/modules/{glesx.so,amdxmm.so}
203
204 + #516816
205 + if use gdm-hack; then
206 + sed -i 's#/proc/%i/fd/0#/etc/ati/xvrn#g' "${D}/usr/$(get_libdir)/xorg/modules/drivers/fglrx_drv.so" || die "Applying gdm-hack failed"
207 + fi
208 +
209 # Arch-specific files.
210 # (s)bin.
211 into /opt
212 @@ -466,12 +453,16 @@ src_install() {
213 newinitd "${FILESDIR}"/atieventsd.init atieventsd
214 echo 'ATIEVENTSDOPTS=""' > "${T}"/atieventsd.conf
215 newconfd "${T}"/atieventsd.conf atieventsd
216 + systemd_dounit "${FILESDIR}/atieventsd.service"
217
218 # PowerXpress stuff
219 exeinto /usr/$(get_libdir)/fglrx
220 doexe "${FILESDIR}"/switchlibGL || die "doexe switchlibGL failed"
221 cp "${FILESDIR}"/switchlibGL "${T}"/switchlibglx
222 doexe "${T}"/switchlibglx || die "doexe switchlibglx failed"
223 +
224 + #516816
225 + use gdm-hack && Xorg -version > "${D}/etc/ati/xvrn" 2>&1
226 }
227
228 src_install-libs() {
229 @@ -501,9 +492,16 @@ src_install-libs() {
230 dosym libGL.so.${libver} ${ATI_ROOT}/lib/libGL.so.${libmajor}
231 dosym libGL.so.${libver} ${ATI_ROOT}/lib/libGL.so
232
233 - exeinto ${ATI_ROOT}/extensions
234 - doexe "${EX_BASE_DIR}"/usr/X11R6/${pkglibdir}/modules/extensions/fglrx/fglrx-libglx.so
235 - mv "${D}"/${ATI_ROOT}/extensions/{fglrx-,}libglx.so
236 + if multilib_is_native_abi; then
237 + exeinto ${ATI_ROOT}/extensions
238 + doexe "${EX_BASE_DIR}"/usr/X11R6/${pkglibdir}/modules/extensions/fglrx/fglrx-libglx.so
239 + mv "${D}"/${ATI_ROOT}/extensions/{fglrx-,}libglx.so
240 +
241 + #516816
242 + if use gdm-hack; then
243 + sed -i 's#/proc/%i/fd/0#/etc/ati/xvrn#g' "${D}/${ATI_ROOT}/extensions/libglx.so" || die "Applying gdm-hack failed"
244 + fi
245 + fi
246
247 # other libs
248 exeinto /usr/$(get_libdir)
249 @@ -560,6 +558,9 @@ src_install-libs() {
250 #install xvba sdk headers
251 doheader xvba_sdk/include/amdxvba.h
252
253 + # VA-API internal wrapper
254 + dosym /usr/$(get_libdir)/libXvBAW.so.1.0 /usr/$(get_libdir)/va/drivers/fglrx_drv_video.so
255 +
256 if use pax_kernel; then
257 pax-mark m "${D}"/usr/lib*/opengl/ati/lib/libGL.so.1.2 || die "pax-mark failed"
258 fi
259
260 diff --git a/x11-drivers/ati-drivers/files/ati-drivers-15.11-remove-gpl-symbols.patch b/x11-drivers/ati-drivers/files/ati-drivers-15.11-remove-gpl-symbols.patch
261 new file mode 100644
262 index 0000000..5cea796
263 --- /dev/null
264 +++ b/x11-drivers/ati-drivers/files/ati-drivers-15.11-remove-gpl-symbols.patch
265 @@ -0,0 +1,48 @@
266 +--- a/common/lib/modules/fglrx/build_mod/firegl_public.c 2015-09-18 23:57:02.000000000 -0400
267 ++++ b/common/lib/modules/fglrx/build_mod/firegl_public.c 2015-09-18 23:57:11.000000000 -0400
268 +@@ -136,7 +136,6 @@
269 + #include <asm/mman.h>
270 + #include <asm/uaccess.h>
271 + #include <asm/processor.h>
272 +-#include <asm/tlbflush.h> // for flush_tlb_page
273 + #include <asm/cpufeature.h>
274 + #ifdef CONFIG_MTRR
275 + #include <asm/mtrr.h>
276 +@@ -251,6 +250,26 @@
277 + #define WRITE_CR4(x) write_cr4(x)
278 + #endif
279 +
280 ++#define __flush_tlb_one(addr) asm volatile("invlpg (%0)" ::"r" (addr) : "memory")
281 ++#define __flush_tlb() native_write_cr3(native_read_cr3())
282 ++
283 ++static inline void __flush_tlb_all(void)
284 ++{
285 ++ if (cpu_has_pge)
286 ++ {
287 ++ unsigned long flags, cr4;
288 ++ raw_local_irq_save(flags);
289 ++ cr4 = native_read_cr4();
290 ++ native_write_cr4(cr4 & ~X86_CR4_PGE);
291 ++ native_write_cr4(cr4);
292 ++ raw_local_irq_restore(flags);
293 ++ }
294 ++ else
295 ++ {
296 ++ __flush_tlb();
297 ++ }
298 ++}
299 ++
300 + // ============================================================
301 + /* globals */
302 +
303 +--- a/common/lib/modules/fglrx/build_mod/kcl_acpi.c 2015-09-19 00:43:35.000000000 -0400
304 ++++ b/common/lib/modules/fglrx/build_mod/kcl_acpi.c 2015-09-19 00:43:48.000000000 -0400
305 +@@ -868,7 +868,7 @@ void ATI_API_CALL KCL_ACPI_No_Hotplug(vo
306 + #elif LINUX_VERSION_CODE >= KERNEL_VERSION(3,17,0)
307 + if(pdev)
308 + {
309 +-#if (UTS_UBUNTU_RELEASE_ABI < 0 && LINUX_VERSION_CODE < KERNEL_VERSION(4,1,3)) || (UTS_UBUNTU_RELEASE_ABI >= 0 && UTS_UBUNTU_RELEASE_ABI < 26 && LINUX_VERSION_CODE <= KERNEL_VERSION(3,19,8))
310 ++#if 0 && (UTS_UBUNTU_RELEASE_ABI < 0 && LINUX_VERSION_CODE < KERNEL_VERSION(4,1,3)) || (UTS_UBUNTU_RELEASE_ABI >= 0 && UTS_UBUNTU_RELEASE_ABI < 26 && LINUX_VERSION_CODE <= KERNEL_VERSION(3,19,8))
311 + pci_ignore_hotplug(pdev);
312 + #else
313 + pdev->ignore_hotplug = 1;
314
315 diff --git a/x11-drivers/ati-drivers/files/atieventsd.service b/x11-drivers/ati-drivers/files/atieventsd.service
316 new file mode 100644
317 index 0000000..72df6c4
318 --- /dev/null
319 +++ b/x11-drivers/ati-drivers/files/atieventsd.service
320 @@ -0,0 +1,9 @@
321 +[Unit]
322 +Description=Catalyst event Daemon
323 +Requires=acpid.socket
324 +
325 +[Service]
326 +ExecStart=/opt/sbin/atieventsd --nodaemon
327 +
328 +[Install]
329 +WantedBy=multi-user.target