Commit 8f6beb71 authored by Phil's avatar Phil

update catalyst to 11.2

parent f6a55c8b
......@@ -5,13 +5,13 @@
# maintainer (x86_64): Manuel Tortosa <manutortosa[at]chakra-project[dot]org>
pkgname=catalyst-utils
pkgver=11.1
pkgver=11.2
pkgrel=1
pkgdesc="AMD/ATI Catalyst drivers utilities and libraries."
arch=('i686' 'x86_64')
url="http://www.ati.amd.com"
license=('custom')
depends=('xorg-server>=1.9.0' 'xorg-server<1.10.0' 'netkit-bsd-finger' 'libxrandr' 'libsm' 'fontconfig' 'libxcursor' 'libxi' 'gcc-libs')
depends=('xorg-server>=1.7.0' 'xorg-server<1.10.0' 'netkit-bsd-finger' 'libxrandr' 'libsm' 'fontconfig' 'libxcursor' 'libxi' 'gcc-libs')
optdepends=('qt: to run ATi Catalyst Control Center (amdcccle)')
replaces=('libgl')
conflicts=('catalyst-test' 'nvidia-utils' 'libgl')
......@@ -25,7 +25,7 @@ source=(
amdcccle.desktop
atieventsd.sh)
md5sums=('f28f358b3a40a0a06e16f45925d9a875'
md5sums=('4db782c2a7924b965918275c39157a28'
'bdafe749e046bfddee2d1c5e90eabd83'
'4efa8414a8fe9eeb50da38b5522ef81d'
'f729bf913613f49b0b9759c246058a87')
......@@ -64,12 +64,13 @@ package() {
# X.org driver
if [ "${CARCH}" = "i686" ]; then
cd "${srcdir}/archive_files/x760/usr/X11R6/lib/modules" || return 1
cd "${srcdir}/archive_files/xpic/usr/X11R6/lib/modules" || return 1
elif [ "${CARCH}" = "x86_64" ]; then
cd "${srcdir}/archive_files/x760_64a/usr/X11R6/lib64/modules" || return 1
cd "${srcdir}/archive_files/xpic_64a/usr/X11R6/lib64/modules" || return 1
fi
#install -m644 *.a "${pkgdir}/usr/lib/xorg/modules/" || return 1
# *.a added in 11.2
install -m644 *.a "${pkgdir}/usr/lib/xorg/modules/" || return 1
install -m755 *.so "${pkgdir}/usr/lib/xorg/modules/" || return 1
install -m755 drivers/*.so "${pkgdir}/usr/lib/xorg/modules/drivers/" || return 1
install -m755 linux/*.so "${pkgdir}/usr/lib/xorg/modules/linux/" || return 1
......@@ -120,8 +121,7 @@ package() {
install -m644 usr/X11R6/bin/amdupdaterandrconfig "${pkgdir}/usr/bin/" || return 1
install -m644 usr/include/GL/*.h "${pkgdir}/usr/include/GL/" || return 1
install -m755 usr/sbin/*.sh "${pkgdir}/usr/sbin/" || return 1
install -m644 usr/share/ati/amdcccle/* "${pkgdir}/usr/share/ati/amdcccle/" || return 1 # ? what are these files for?
# install -m644 usr/share/gnome/apps/amdcccle.desktop "${pkgdir}/usr/share/applications/" || return 1
install -m644 usr/share/ati/amdcccle/* "${pkgdir}/usr/share/ati/amdcccle/" || return 1
install -m644 usr/share/icons/*.xpm "${pkgdir}/usr/share/pixmaps/" || return 1
install -m644 usr/share/man/man8/*.8 "${pkgdir}/usr/share/man/man8/" || return 1
install -m644 "${srcdir}/amdcccle.desktop" "${pkgdir}/usr/share/applications/" || return 1
......
......@@ -22,6 +22,9 @@ whisperer(){
echo "[as root] kill Xserver and use this command:"
echo "# aticonfig --set-pcs-str=DDX,ForceXAA,TRUE"
echo "----------------------------------------------------------------"
echo "For more info and more troubleshooting visit:"
echo "http://wiki.archlinux.org/index.php/ATI_Catalyst"
echo "----------------------------------------------------------------"
}
check_libdri_so(){
......
--- cat11.1/common/lib/modules/fglrx/build_mod/firegl_public.c 2011-01-17 15:59:26.000000000 +0100
+++ cat11.1/common/lib/modules/fglrx/build_mod/firegl_public.c 2011-02-01 18:39:08.902218444 +0100
@@ -848,7 +848,12 @@
* happen much less frequent then without this workaround.
*/
if (state == PM_EVENT_SUSPEND)
- acquire_console_sem();
+
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,38)
+ console_lock();
+#else
+ acquire_console_sem();
+#endif
if (firegl_cail_powerdown(privdev, state))
ret = -EIO;
@@ -870,8 +875,13 @@
}
if (state == PM_EVENT_SUSPEND)
- release_console_sem();
-
+
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,38)
+ console_unlock();
+#else
+ release_console_sem();
+#endif
+
KCL_DEBUG_TRACEOUT(FN_FIREGL_ACPI, ret, NULL);
return ret;
@@ -894,7 +904,12 @@
if (PMSG_EVENT(pdev->dev.power.power_state) == 0) return 0;
if (PMSG_EVENT(pdev->dev.power.power_state) == PM_EVENT_SUSPEND)
- acquire_console_sem();
+
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,38)
+ console_lock();
+#else
+ acquire_console_sem();
+#endif
#ifdef FIREGL_USWC_SUPPORT
// Restore the PAT after resuming from S3 or S4.
@@ -919,7 +934,12 @@
firegl_cail_powerup(privdev);
if (PMSG_EVENT(pdev->dev.power.power_state) == PM_EVENT_SUSPEND)
- release_console_sem();
+
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,38)
+ console_unlock();
+#else
+ release_console_sem();
+#endif
PMSG_EVENT(pdev->dev.power.power_state) = 0;
KCL_DEBUG_TRACEOUT(FN_FIREGL_ACPI, 0, NULL);
......@@ -8,35 +8,37 @@
_kernver=`pacman -Qf kernel26 | cut -c10-15 | sed 's/kernel26 //g'`-CHAKRA
pkgname=catalyst
pkgver=11.1
pkgver=11.2
pkgrel=1
pkgdesc="AMD/ATI Catalyst drivers for kernel26. fglrx kernel module only"
arch=('i686' 'x86_64')
url="http://www.ati.amd.com"
license=('custom')
depends=('kernel26>=2.6.37' 'kernel26<2.6.39' "catalyst-utils=${pkgver}")
makedepends=('kernel26-headers' 'gcc-libs' 'gcc>4.0.0' 'make')
depends=('kernel26>=2.6.29' 'kernel26<2.6.39' "catalyst-utils=${pkgver}")
makedepends=('gcc-libs' 'gcc>4.0.0' 'make' 'kernel26-headers')
conflicts=('catalyst-test' 'nvidia' 'xf86-video-ati' 'xf86-video-radeonhd' 'ati-dri')
install=${pkgname}.install
#patch_file="fglrx-2.6.36.patch"
#patch_md5="eb58dbf993dbf8d77924055cc8caaeb6"
#patch_target="2.6.36"
source=(http://www2.ati.com/drivers/linux/ati-driver-installer-${pkgver/./-}-x86.x86_64.run
ati_make.sh
makefile_compat.patch
2.6.38_console.patch)
source=(
http://www2.ati.com/drivers/linux/ati-driver-installer-${pkgver/./-}-x86.x86_64.run
makefile_compat.patch)
# ${patch_file})
md5sums=('f28f358b3a40a0a06e16f45925d9a875'
'3e1b82bd69774ea808da69c983d6a43b')
# ${patch_md5}
md5sums=('4db782c2a7924b965918275c39157a28'
'660396540b0ceaff71d6155c986734de'
'3e1b82bd69774ea808da69c983d6a43b'
'dde819cfc936032f98aa04a5d404b3ad')
build() {
## Unpack archive
msg "Setting compilation variables ..."
## include ati_make.sh and use _ati_check function from it
. ati_make.sh
_ati_check
msg "Unpacking archive ..."
/bin/sh ./ati-driver-installer-${pkgver/./-}-x86.x86_64.run --extract archive_files
......@@ -52,153 +54,26 @@ build() {
cd "${srcdir}/archive_files/"
msg "Applying patch(es) ..."
## makefile patch to choose arch_compat_alloc_user_space or older compat_alloc_user_space
## works only in combination with ati_make.sh script
patch -Np1 -i ../makefile_compat.patch || return 1
## 2.6.38 patch made for 2.6.38rc3
patch -Np1 -i ../2.6.38_console.patch || return 1
# if [[ ${_kernver:0:6} == "2.6.37" ]] || [[ ${_kernver:0:6} > "2.6.37" ]]; then
# patch -Np1 -i ../sema_init.patch || return 1
# fi
###--- cut ---### ati's code from their make.sh file
# Copyright 1999-2005 ATI Technologies Inc., Markham, Ontario, CANADA.
# All Rights Reserved.
# ==============================================================
# resolve if we are running a SMP enabled kernel
SMP=0
# 1
# grep in OsVersion string for SMP specific keywords
OsVersion=`uname -v`
if [ `echo $OsVersion | grep [sS][mM][pP] -c` -ne 0 ]; then
SMP=1
echo "OsVersion says: SMP=$SMP"
fi
# 2
# grep in /proc/ksyms for SMP specific kernel symbols
# use triggerlevel of 10 occurences
# (UP kernels might have 0-1, SMP kernels might have 32-45 or much more)
src_file=/proc/kallsyms
if [ -e $src_file ]; then
if [ `fgrep smp $src_file -c` -gt 10 ]; then
SMP=1
echo "file $src_file says: SMP=$SMP"
fi
fi
# 3
# linux/autoconf.h may contain this: #define CONFIG_SMP 1
# Before 2.6.33 autoconf.h is under linux/.
# For 2.6.33 and later autoconf.h is under generated/.
if [ -f /lib/modules/${_kernver}/build/include/generated/autoconf.h ]; then
autoconf_h=/lib/modules/${_kernver}/build/include/generated/autoconf.h
else
autoconf_h=/lib/modules/${_kernver}/build/include/linux/autoconf.h
fi
src_file=$autoconf_h
if [ ! -e $src_file ]; then
echo "Warning:"
echo "kernel includes at /lib/modules/${_kernver}/build/include not found or incomplete"
echo "file: $src_file"
echo ""
else
if [ `cat $src_file | grep "#undef" | grep "CONFIG_SMP" -c` = 0 ]; then
SMP=`cat $src_file | grep CONFIG_SMP | cut -d' ' -f3`
echo "file $src_file says: SMP=$SMP"
fi
fi
if [ "$SMP" = 0 ]; then
echo "assuming default: SMP=$SMP"
fi
# act on final result
if [ ! "$SMP" = 0 ]; then
smp="-SMP"
def_smp=-D__SMP__
fi
# ==============================================================
# resolve whether we need to set PAGE_ATTR_FIX
PAGE_ATTR_FIX=0
src_file=/proc/kallsyms
if [ -e $src_file ]; then
if [ `fgrep " change_page_attr\$" $src_file -c` -gt 0 ]; then
PAGE_ATTR_FIX=1
echo "file $src_file says: PAGE_ATTR_FIX=$PAGE_ATTR_FIX"
fi
fi
# ==============================================================
# resolve if we are running a MODVERSIONS enabled kernel
MODVERSIONS=0
# autoconf.h may contain this: #define CONFIG_MODVERSIONS 1
src_file=$autoconf_h
if [ ! -e $src_file ];
then
echo "Warning:"
echo "kernel includes at /lib/modules/${_kernver}/build/include not found or incomplete"
echo "file: $src_file"
echo ""
else
if [ `cat $src_file | grep "#undef" | grep "CONFIG_MODVERSIONS" -c` = 0 ]
then
MODVERSIONS=`cat $src_file | grep CONFIG_MODVERSIONS | cut -d' ' -f3`
echo "file $src_file says: MODVERSIONS=$MODVERSIONS"
fi
fi
if [ "$MODVERSIONS" = 0 ]
then
echo "assuming default: MODVERSIONS=$MODVERSIONS"
fi
# act on final result
if [ ! "$MODVERSIONS" = 0 ]
then
def_modversions="-DMODVERSIONS"
fi
# ==============================================================
# resolve if we are building for a kernel with a fix for CVE-2010-3081
# On kernels with the fix, use arch_compat_alloc_user_space instead
# of compat_alloc_user_space since the latter is GPL-only
COMPAT_ALLOC_USER_SPACE=compat_alloc_user_space
src_file=/lib/modules/${_kernver}/build/arch/x86/include/asm/compat.h
if [ ! -e $src_file ];
then
echo "Warning:"
echo "kernel includes at /lib/modules/${_kernver}/build/include not found or incomplete"
echo "file: $src_file"
echo ""
else
if [ `cat $src_file | grep -c arch_compat_alloc_user_space` -gt 0 ]
then
COMPAT_ALLOC_USER_SPACE=arch_compat_alloc_user_space
fi
echo "file $src_file says: COMPAT_ALLOC_USER_SPACE=$COMPAT_ALLOC_USER_SPACE"
fi
# ==============================================================
###--- cut ---###
cd "${srcdir}/archive_files/common/lib/modules/fglrx/build_mod"
cp "${srcdir}/archive_files/arch/${_archdir}/lib/modules/fglrx/build_mod/libfglrx_ip.a.GCC4" . || return 1
cp 2.6.x/Makefile . || return 1
## Compiling module
msg "Compiling fglrx module ..."
## Compile module using _ati_check variables
make -C /lib/modules/${_kernver}/build SUBDIRS="`pwd`" ARCH=${BUILDARCH} \
MODFLAGS="-DMODULE -DATI -DFGL -DPAGE_ATTR_FIX=$PAGE_ATTR_FIX -DCOMPAT_ALLOC_USER_SPACE=$COMPAT_ALLOC_USER_SPACE $def_smp $def_modversions" \
PAGE_ATTR_FIX=$PAGE_ATTR_FIX COMPAT_ALLOC_USER_SPACE=$COMPAT_ALLOC_USER_SPACE modules || return 1
......@@ -208,9 +83,9 @@ package() {
cd "${srcdir}/archive_files/common/lib/modules/fglrx/build_mod"
install -m755 -d "${pkgdir}/lib/modules/${_kernver}/video/" || return 1
install -m644 fglrx.ko "${pkgdir}/lib/modules/${_kernver}/video/" || return 1
install -m755 -d "${pkgdir}/usr/share/licenses/${pkgname}"
## License
install -m755 -d "${pkgdir}/usr/share/licenses/${pkgname}"
install -m644 "${srcdir}/archive_files/ATI_LICENSE.TXT" "${pkgdir}/usr/share/licenses/${pkgname}/" || return 1
sed -i -e "s/KERNEL_VERSION=.*/KERNEL_VERSION=${_kernver}/" $startdir/*.install
......
#!/bin/bash
### Vi0L0: it is ati's code from their make.sh file, modified a bit to fit our arch linux system, used inside PKGBUILD
# Copyright 1999-2005 ATI Technologies Inc., Markham, Ontario, CANADA.
# All Rights Reserved.
#
# Your use and or redistribution of this software in source and \ or
# binary form, with or without modification, is subject to: (i) your
# ongoing acceptance of and compliance with the terms and conditions of
# the ATI Technologies Inc. software End User License Agreement; and (ii)
# your inclusion of this notice in any version of this software that you
# use or redistribute. A copy of the ATI Technologies Inc. software End
# User License Agreement is included with this software and is also
# available by contacting ATI Technologies Inc. at http://www.ati.com
function _ati_check()
{
# ==============================================================
# resolve if we are running a SMP enabled kernel
SMP=0
# 1
# grep in OsVersion string for SMP specific keywords
OsVersion=`uname -v`
if [ `echo $OsVersion | grep [sS][mM][pP] -c` -ne 0 ]; then
SMP=1
echo "OsVersion says: SMP=$SMP"
fi
# 2
# grep in /proc/ksyms for SMP specific kernel symbols
# use triggerlevel of 10 occurences
# (UP kernels might have 0-1, SMP kernels might have 32-45 or much more)
src_file=/proc/kallsyms
if [ -e $src_file ]; then
if [ `fgrep smp $src_file -c` -gt 10 ]; then
SMP=1
echo "file $src_file says: SMP=$SMP"
fi
fi
# 3
# linux/autoconf.h may contain this: #define CONFIG_SMP 1
# Before 2.6.33 autoconf.h is under linux/.
# For 2.6.33 and later autoconf.h is under generated/.
if [ -f /lib/modules/${_kernver}/build/include/generated/autoconf.h ]; then
autoconf_h=/lib/modules/${_kernver}/build/include/generated/autoconf.h
else
autoconf_h=/lib/modules/${_kernver}/build/include/linux/autoconf.h
fi
src_file=$autoconf_h
if [ ! -e $src_file ]; then
echo "Warning:"
echo "kernel includes at /lib/modules/${_kernver}/build/include not found or incomplete"
echo "file: $src_file"
echo ""
else
if [ `cat $src_file | grep "#undef" | grep "CONFIG_SMP" -c` = 0 ]; then
SMP=`cat $src_file | grep CONFIG_SMP | cut -d' ' -f3`
echo "file $src_file says: SMP=$SMP"
fi
fi
if [ "$SMP" = 0 ]; then
echo "assuming default: SMP=$SMP"
fi
# act on final result
if [ ! "$SMP" = 0 ]; then
smp="-SMP"
def_smp=-D__SMP__
fi
# ==============================================================
# resolve whether we need to set PAGE_ATTR_FIX
PAGE_ATTR_FIX=0
src_file=/proc/kallsyms
if [ -e $src_file ]; then
if [ `fgrep " change_page_attr\$" $src_file -c` -gt 0 ]; then
PAGE_ATTR_FIX=1
echo "file $src_file says: PAGE_ATTR_FIX=$PAGE_ATTR_FIX"
fi
fi
# ==============================================================
# resolve if we are running a MODVERSIONS enabled kernel
MODVERSIONS=0
# autoconf.h may contain this: #define CONFIG_MODVERSIONS 1
src_file=$autoconf_h
if [ ! -e $src_file ];
then
echo "Warning:"
echo "kernel includes at /lib/modules/${_kernver}/build/include not found or incomplete"
echo "file: $src_file"
echo ""
else
if [ `cat $src_file | grep "#undef" | grep "CONFIG_MODVERSIONS" -c` = 0 ]
then
MODVERSIONS=`cat $src_file | grep CONFIG_MODVERSIONS | cut -d' ' -f3`
echo "file $src_file says: MODVERSIONS=$MODVERSIONS"
fi
fi
if [ "$MODVERSIONS" = 0 ]
then
echo "assuming default: MODVERSIONS=$MODVERSIONS"
fi
# act on final result
if [ ! "$MODVERSIONS" = 0 ]
then
def_modversions="-DMODVERSIONS"
fi
# ==============================================================
# resolve if we are building for a kernel with a fix for CVE-2010-3081
# On kernels with the fix, use arch_compat_alloc_user_space instead
# of compat_alloc_user_space since the latter is GPL-only
COMPAT_ALLOC_USER_SPACE=compat_alloc_user_space
src_file=/lib/modules/${_kernver}/build/arch/x86/include/asm/compat.h
if [ ! -e $src_file ];
then
echo "Warning:"
echo "kernel includes at /lib/modules/${_kernver}/build/include not found or incomplete"
echo "file: $src_file"
echo ""
else
if [ `cat $src_file | grep -c arch_compat_alloc_user_space` -gt 0 ]
then
COMPAT_ALLOC_USER_SPACE=arch_compat_alloc_user_space
fi
echo "file $src_file says: COMPAT_ALLOC_USER_SPACE=$COMPAT_ALLOC_USER_SPACE"
fi
}
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment