From 607b3158d11c10763513c63813d7e77c89152226 Mon Sep 17 00:00:00 2001 From: BlackNoxis Date: Mon, 19 Jan 2015 12:32:35 +0200 Subject: Added ati-drivers 14.12 --- x11-drivers/ati-drivers/Manifest | 1 + .../ati-drivers/ati-drivers-14.12-r3.ebuild | 204 +++++++++++++++++++++ .../fix-the-linux-3.17-no_hotplug-error.patch | 18 ++ .../ati-drivers/files/use-kernel_fpu_begin.patch | 12 ++ 4 files changed, 235 insertions(+) create mode 100644 x11-drivers/ati-drivers/ati-drivers-14.12-r3.ebuild create mode 100644 x11-drivers/ati-drivers/files/fix-the-linux-3.17-no_hotplug-error.patch create mode 100644 x11-drivers/ati-drivers/files/use-kernel_fpu_begin.patch diff --git a/x11-drivers/ati-drivers/Manifest b/x11-drivers/ati-drivers/Manifest index 68136a7f..b0172763 100644 --- a/x11-drivers/ati-drivers/Manifest +++ b/x11-drivers/ati-drivers/Manifest @@ -2,6 +2,7 @@ DIST amd-catalyst-13.12-linux-x86.x86_64.zip 160571830 SHA256 024033f4847d1c2a18 DIST amd-catalyst-13.4-linux-x86.x86_64.zip 122588023 SHA256 ebec78c7f78db3601d1c97116a6823076a7765318e16d88b619ebc80d4c6d1d5 SHA512 ce012f46527ee0073f658e97dd793954930b934b96be9e1c6cd1d344e7734ef81949b484701d5e7e1ebb221f46b5a617f4efb4445e42c06ac0a8b4eca76463fc WHIRLPOOL cb0f7af6d0474c3d521c5785bab49d76da7e09e1ddd02dc0e72b70b5afdb2bd1e07d4a4115a755f213718e7c32c816697d993b73706d58be68fa043aef1ad551 DIST amd-catalyst-13.9-linux-x86.x86_64.zip 120482826 SHA256 ebade5062713c69d2b703b0a3f62defc409d58e98ceab3bfac7a71643c0c4cd3 SHA512 887c1146920ba7e5b31efd63b1a1b7d9cab586e8c6d705706e0b176b3527e542f452d919cd015c3a04d6f42c884f27d983b2a9229b70716129a94674dd7f62b4 WHIRLPOOL d8b6c7ed772898914c256674ae08a8b3d3054eb5bdfc2f00dc4c796a36b4654c3101410786adb54eaae44ff35386db2aa8d8db12d70805f8732d0709412bdbcc DIST amd-catalyst-14-4-linux-x86-x86-64.zip 122867159 SHA256 03cc022a49f47888b04f12343ace82bc1eff3aac524e6b4433848c20dc77fec0 SHA512 b359e6c9c349e7a3bee2bd95d3e39f0c596b9a9066893ade3eefcc89ee792094d26a04b2f6bdc31431b368a90ae5870ef07f848a4cbcca723ca1c7c3fcf79d98 WHIRLPOOL bd81574e1fc3be3f82ff51392a3044694e2834ce57395f9d4fe1a89dfa4bebd4b9fe24bc739a45173305bd267d1752226f0648145d5982c9dbe2a0ed23cf37f6 +DIST amd-catalyst-omega-14.12-linux-run-installers.zip 155616187 SHA256 68669836f20ad4351e08b13c5766c6b2ffc6b8cd2a37e9baf55779da32d3a249 SHA512 f87be6a56c03ca4aae3782668af8700d83c85872387753cf002ba4a0e0816fae9af29841a4390db972bfe2f7fb853571b32f8434c2008983461b80699347ac21 WHIRLPOOL 2675a387abd372b34c51f4e8ebfd6547300a8c3ffcc0562633838bc0cdaec3675ca3f4cfa2ab7481c8fa1238a46059f5f848611780638ef6d2301a527d900326 DIST amd-driver-installer-12-1-x86.x86_64.run 50201 SHA256 e3d63bfaeefff0a23f5af6df2592b7876e63a0a360e62adbf6fafdaa9b681c77 SHA512 6a69af5a00fa28bfaf36aff45723abd78072753ebb29808456494237daad79a78d7d6ad1701ee1fac235a0166446a9683198372314980c05746e4198861c8d76 WHIRLPOOL f5a30b24869ff77c8be180e372482b6b1d979618fd93dd20adb2cfc7610020e0068a48e3d96f7905d673af6f1a17ae0eb2d54e84b23d46a35a1c8472a0bfbe6b DIST amd-driver-installer-12-2-x86.x86_64.run 50201 SHA256 e3d63bfaeefff0a23f5af6df2592b7876e63a0a360e62adbf6fafdaa9b681c77 SHA512 6a69af5a00fa28bfaf36aff45723abd78072753ebb29808456494237daad79a78d7d6ad1701ee1fac235a0166446a9683198372314980c05746e4198861c8d76 WHIRLPOOL f5a30b24869ff77c8be180e372482b6b1d979618fd93dd20adb2cfc7610020e0068a48e3d96f7905d673af6f1a17ae0eb2d54e84b23d46a35a1c8472a0bfbe6b DIST amd-driver-installer-12-3-x86.x86_64.run 50201 SHA256 e3d63bfaeefff0a23f5af6df2592b7876e63a0a360e62adbf6fafdaa9b681c77 SHA512 6a69af5a00fa28bfaf36aff45723abd78072753ebb29808456494237daad79a78d7d6ad1701ee1fac235a0166446a9683198372314980c05746e4198861c8d76 WHIRLPOOL f5a30b24869ff77c8be180e372482b6b1d979618fd93dd20adb2cfc7610020e0068a48e3d96f7905d673af6f1a17ae0eb2d54e84b23d46a35a1c8472a0bfbe6b diff --git a/x11-drivers/ati-drivers/ati-drivers-14.12-r3.ebuild b/x11-drivers/ati-drivers/ati-drivers-14.12-r3.ebuild new file mode 100644 index 00000000..31ec4329 --- /dev/null +++ b/x11-drivers/ati-drivers/ati-drivers-14.12-r3.ebuild @@ -0,0 +1,204 @@ +# Copyright 1999-2015 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: $ + +EAPI=5 + +MULTILIB_COMPAT=( abi_x86_{32,64} ) +inherit eutils multilib-build linux-info linux-mod toolchain-funcs versionator pax-utils + +DESCRIPTION="Ati precompiled drivers for Radeon Evergreen (HD5000 Series) and newer chipsets" +HOMEPAGE="http://www.amd.com" +RUN="${WORKDIR}/fglrx-14.501.1003/amd-driver-installer-14.501.1003-x86.x86_64.run" +SLOT="1" +# Uses javascript for download YESSSS +#DRIVERS_URI="http://www2.ati.com/drivers/linux/amd-catalyst-13.12-linux-x86.x86_64.zip" +DRIVERS_URI="mirror://gentoo/amd-catalyst-omega-14.12-linux-run-installers.zip" +XVBA_SDK_URI="http://developer.amd.com/wordpress/media/2012/10/xvba-sdk-0.74-404001.tar.gz" +SRC_URI="${DRIVERS_URI} ${XVBA_SDK_URI}" +FOLDER_PREFIX="common/" +IUSE="debug pax_kernel" + +LICENSE="AMD GPL-2 QPL-1.0" +KEYWORDS="-* ~amd64 ~x86" +RESTRICT="bindist test" + +RDEPEND="~x11-drivers/ati-userspace-${PV} + sys-power/acpid" +DEPEND="${RDEPEND} + sys-apps/findutils + app-misc/pax-utils + app-arch/unzip +" + +S="${WORKDIR}" + +pkg_pretend() { + local CONFIG_CHECK="~MTRR ~!DRM ACPI PCI_MSI !LOCKDEP !PAX_KERNEXEC_PLUGIN_METHOD_OR" + use amd64 && CONFIG_CHECK+=" COMPAT" + + local ERROR_MTRR="CONFIG_MTRR required for direct rendering." + local ERROR_DRM="CONFIG_DRM must be disabled or compiled as a module and not loaded for direct + rendering to work." + local ERROR_LOCKDEP="CONFIG_LOCKDEP (lock tracking) exports the symbol lock_acquire + as GPL-only. This prevents ${P} from compiling with an error like this: + FATAL: modpost: GPL-incompatible module fglrx.ko uses GPL-only symbol 'lock_acquire'" + local ERROR_PAX_KERNEXEC_PLUGIN_METHOD_OR="This config option will cause + kernel to reject loading the fglrx module with + \"ERROR: could not insert 'fglrx': Exec format error.\" + You may want to try CONFIG_PAX_KERNEXEC_PLUGIN_METHOD_BTS instead." + local ERROR_BKL="CONFIG_BKL must be enabled for kernels 2.6.37-2.6.38." + + # workaround until bug 365543 is solved + linux-info_pkg_setup + require_configured_kernel + + kernel_is ge 2 6 37 && kernel_is le 2 6 38 && CONFIG_CHECK+=" BKL" + check_extra_config + if ! linux_chkconfig_present AGP && \ + ! linux_chkconfig_present PCIEPORTBUS; then + ewarn "You don't have AGP and/or PCIe support enabled in the kernel" + ewarn "Direct rendering will not work." + fi + + if ! has XT ${PAX_MARKINGS} && use pax_kernel; then + ewarn "You have disabled xattr pax markings for portage." + ewarn "This will likely cause programs using ati-drivers provided" + ewarn "libraries to be killed kernel." + fi +} + +pkg_setup() { + MODULE_NAMES="fglrx(video:${S}/${FOLDER_PREFIX}/lib/modules/fglrx/build_mod/2.6.x)" + BUILD_TARGETS="kmod_build" + linux-mod_pkg_setup + BUILD_PARAMS="GCC_VER_MAJ=$(gcc-major-version) KVER=${KV_FULL} KDIR=${KV_DIR}" + BUILD_PARAMS="${BUILD_PARAMS} CFLAGS_MODULE+=\"-DMODULE -DATI -DFGL\"" + if grep -q arch_compat_alloc_user_space ${KV_DIR}/arch/x86/include/asm/compat.h ; then + BUILD_PARAMS="${BUILD_PARAMS} CFLAGS_MODULE+=-DCOMPAT_ALLOC_USER_SPACE=arch_compat_alloc_user_space" + else + BUILD_PARAMS="${BUILD_PARAMS} CFLAGS_MODULE+=-DCOMPAT_ALLOC_USER_SPACE=compat_alloc_user_space" + fi + # Define module dir. + MODULE_DIR="${S}/${FOLDER_PREFIX}/lib/modules/fglrx/build_mod" + # get the xorg-server version and set BASE_DIR for that + BASE_DIR="${S}/xpic" + + # amd64/x86 + if use amd64 ; then + MY_BASE_DIR="${BASE_DIR}_64a" + PKG_LIBDIR=lib64 + ARCH_DIR="${S}/arch/x86_64" + else + MY_BASE_DIR="${BASE_DIR}" + PKG_LIBDIR=lib + ARCH_DIR="${S}/arch/x86" + fi + + elog + elog "Please note that this driver only supports graphic cards based on" + elog "Evergreen chipset and newer." + elog "This includes the AMD Radeon HD 5400+ series at this moment." + elog + elog "If your card is older then use ${CATEGORY}/xf86-video-ati" + elog "For migration information please refer to:" + elog "http://www.gentoo.org/proj/en/desktop/x/x11/ati-migration-guide.xml" + einfo +} + +src_unpack() { + local DRIVERS_DISTFILE XVBA_SDK_DISTFILE + DRIVERS_DISTFILE=${DRIVERS_URI##*/} + XVBA_SDK_DISTFILE=${XVBA_SDK_URI##*/} + + if [[ ${DRIVERS_DISTFILE} =~ .*\.tar\.gz ]]; then + unpack ${DRIVERS_DISTFILE} + else + #please note, RUN may be insanely assigned at top near SRC_URI + if [[ ${DRIVERS_DISTFILE} =~ .*\.zip ]]; then + unpack ${DRIVERS_DISTFILE} + [[ -z "$RUN" ]] && RUN="${S}/${DRIVERS_DISTFILE/%.zip/.run}" + else + RUN="${DISTDIR}/${DRIVERS_DISTFILE}" + fi + sh "${RUN}" --extract "${S}" 2>&1 > /dev/null || die + fi + + mkdir xvba_sdk + cd xvba_sdk + unpack ${XVBA_SDK_DISTFILE} + + mkdir -p "${WORKDIR}/extra" || die "mkdir extra failed" + cd "${WORKDIR}/extra" + tar -xf "../${FOLDER_PREFIX}usr/src/ati/fglrx_sample_source.tgz" +} + +src_prepare() { + # version patches + # epatch "${FILESDIR}"/kernel/${PV}-*.patch + if use debug; then + sed -i '/^#define DRM_DEBUG_CODE/s/0/1/' \ + "${MODULE_DIR}/firegl_public.c" \ + || die "Failed to enable debug output." + fi + + # see http://ati.cchtml.com/show_bug.cgi?id=495 + #epatch "${FILESDIR}"/ati-drivers-old_rsp.patch + # first hunk applied upstream second (x32 related) was not + epatch "${FILESDIR}"/ati-drivers-x32_something_something.patch + + # compile fix for AGP-less kernel, bug #435322 + epatch "${FILESDIR}"/ati-drivers-12.9-KCL_AGP_FindCapsRegisters-stub.patch + + epatch "${FILESDIR}/ati-drivers-13.8-beta-include-seq_file.patch" + + # Fix #483400 + epatch "${FILESDIR}/fgl_glxgears-do-not-include-glATI.patch" + + # Fix #524658 + epatch "${FILESDIR}/fix-the-linux-3.17-no_hotplug-error.patch" + + # Compile fix, https://bugs.gentoo.org/show_bug.cgi?id=454870 + use pax_kernel && epatch "${FILESDIR}/const-notifier-block.patch" + + # Compile fix, #526602 + epatch "${FILESDIR}/use-kernel_fpu_begin.patch" + + cd "${MODULE_DIR}" + # bugged fglrx build system, this file should be copied by hand + cp ${ARCH_DIR}/lib/modules/fglrx/build_mod/libfglrx_ip.a 2.6.x + + convert_to_m 2.6.x/Makefile || die "convert_to_m failed" + + # When built with ati's make.sh it defines a bunch of macros if + # certain .config values are set, falling back to less reliable + # detection methods if linux/autoconf.h is not available. We + # simply use the linux/autoconf.h settings directly, bypassing the + # detection script. + sed -i -e 's/__SMP__/CONFIG_SMP/' *.c *h || die "SMP sed failed" + sed -i -e 's/ifdef MODVERSIONS/ifdef CONFIG_MODVERSIONS/' *.c *.h \ + || die "MODVERSIONS sed failed" +} + +src_compile() { + linux-mod_src_compile +} + +src_install() { + linux-mod_src_install +} + +pkg_postinst() { + elog "If you experience unexplained segmentation faults and kernel crashes" + elog "with this driver and multi-threaded applications such as wine," + elog "set UseFastTLS in xorg.conf to either 0 or 1, but not 2." + linux-mod_pkg_postinst +} + +pkg_preinst() { + linux-mod_pkg_preinst +} + +pkg_postrm() { + linux-mod_pkg_postrm +} diff --git a/x11-drivers/ati-drivers/files/fix-the-linux-3.17-no_hotplug-error.patch b/x11-drivers/ati-drivers/files/fix-the-linux-3.17-no_hotplug-error.patch new file mode 100644 index 00000000..a8b54625 --- /dev/null +++ b/x11-drivers/ati-drivers/files/fix-the-linux-3.17-no_hotplug-error.patch @@ -0,0 +1,18 @@ +--- common/lib/modules/fglrx/build_mod/kcl_acpi.c.orig 2014-07-11 11:46:19.000000000 +0200 ++++ common/lib/modules/fglrx/build_mod/kcl_acpi.c 2014-10-08 15:12:55.535638391 +0200 +@@ -829,6 +829,7 @@ + + static acpi_status KCL_ACPI_Slot_No_Hotplug(KCL_ACPI_DevHandle handle, u32 lvl, void *data, void **rv) + { ++#if LINUX_VERSION_CODE < KERNEL_VERSION(3,17,0) + #if LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,7) + struct acpi_device *tdev; + struct pci_dev *pdev = (struct pci_dev *)data; +@@ -844,6 +845,7 @@ + } + } + #endif ++#endif + return 0; + } + diff --git a/x11-drivers/ati-drivers/files/use-kernel_fpu_begin.patch b/x11-drivers/ati-drivers/files/use-kernel_fpu_begin.patch new file mode 100644 index 00000000..f0ba2785 --- /dev/null +++ b/x11-drivers/ati-drivers/files/use-kernel_fpu_begin.patch @@ -0,0 +1,12 @@ +diff -Naur a/common/lib/modules/fglrx/build_mod/firegl_public.c b/common/lib/modules/fglrx/build_mod/firegl_public.c +--- a/common/lib/modules/fglrx/build_mod/firegl_public.c 2014-10-27 23:30:58.630304842 +0200 ++++ b/common/lib/modules/fglrx/build_mod/firegl_public.c 2014-10-27 23:32:57.300306011 +0200 +@@ -6389,7 +6389,7 @@ + */ + void ATI_API_CALL KCL_fpu_begin(void) + { +-#ifdef CONFIG_X86_64 ++#if defined(CONFIG_X86_64) || LINUX_VERSION_CODE >= KERNEL_VERSION(3,17,0) + kernel_fpu_begin(); + #else + #ifdef TS_USEDFPU -- cgit v1.2.3