3
0
Fork 0
forked from mirrors/nixpkgs

linuxPackages.ati_drivers_x11: remove

Driver is no longer supported for kernels >= 4.1.
This commit is contained in:
Jonathan Ringer 2021-05-18 17:54:44 -07:00
parent 4e211c1b09
commit 7117588d26
No known key found for this signature in database
GPG key ID: 5C841D3CFDFEC4E0
13 changed files with 1 additions and 789 deletions

View file

@ -1,302 +0,0 @@
# TODO gentoo removes some tools because there are xorg sources (?)
source $stdenv/setup
set -x
die(){ echo $@; exit 1; }
unzip $src
run_file=fglrx-$build/amd-driver-installer-$build-x86.x86_64.run
sh $run_file --extract .
for patch in $patches;do
patch -p1 < $patch
done
case "$system" in
x86_64-linux)
arch=x86_64
lib_arch=lib64
DIR_DEPENDING_ON_XORG_VERSION=xpic_64a
;;
i686-linux)
arch=x86
lib_arch=lib
DIR_DEPENDING_ON_XORG_VERSION=xpic
;;
*) exit 1;;
esac
# Handle/Build the kernel module.
if test -z "$libsOnly"; then
kernelVersion=$(cd ${kernelDir}/lib/modules && ls)
kernelBuild=$(echo ${kernelDir}/lib/modules/$kernelVersion/build)
linuxsources=$(echo ${kernelDir}/lib/modules/$kernelVersion/source)
# note: maybe the .config file should be used to determine this ?
# current kbuild infrastructure allows using CONFIG_* defines
# but ati sources don't use them yet..
# copy paste from make.sh
setSMP(){
linuxincludes=$kernelBuild/include
# copied and stripped. source: make.sh:
# 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 $linuxincludes/generated/autoconf.h ]; then
autoconf_h=$linuxincludes/generated/autoconf.h
else
autoconf_h=$linuxincludes/linux/autoconf.h
fi
src_file=$autoconf_h
[ -e $src_file ] || die "$src_file not found"
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
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
}
setModVersions(){
! grep CONFIG_MODVERSIONS=y $kernelBuild/.config ||
def_modversions="-DMODVERSIONS"
# make.sh contains much more code to determine this whether its enabled
}
# ==============================================================
# 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=arch_compat_alloc_user_space
for src_file in \
$kernelBuild/arch/x86/include/asm/compat.h \
$linuxsources/arch/x86/include/asm/compat.h \
$kernelBuild/include/asm-x86_64/compat.h \
$linuxsources/include/asm-x86_64/compat.h \
$kernelBuild/include/asm/compat.h;
do
if [ -e $src_file ];
then
break
fi
done
if [ ! -e $src_file ];
then
echo "Warning: x86 compat.h not found in kernel headers"
echo "neither arch/x86/include/asm/compat.h nor include/asm-x86_64/compat.h"
echo "could be found in $kernelBuild or $linuxsources"
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
# make.sh contains some code figuring out whether to use these or not..
PAGE_ATTR_FIX=0
setSMP
setModVersions
CC=gcc
MODULE=fglrx
LIBIP_PREFIX=$TMP/arch/$arch/lib/modules/fglrx/build_mod
[ -d $LIBIP_PREFIX ]
GCC_MAJOR="`gcc --version | grep -o -e ") ." | head -1 | cut -d " " -f 2`"
{ # build .ko module
cd ./common/lib/modules/fglrx/build_mod/2.6.x
echo .lib${MODULE}_ip.a.GCC${GCC_MAJOR}.cmd
echo 'This is a dummy file created to suppress this warning: could not find /lib/modules/fglrx/build_mod/2.6.x/.libfglrx_ip.a.GCC4.cmd for /lib/modules/fglrx/build_mod/2.6.x/libfglrx_ip.a.GCC4' > lib${MODULE}_ip.a.GCC${GCC_MAJOR}.cmd
sed -i -e "s@COMPAT_ALLOC_USER_SPACE@$COMPAT_ALLOC_USER_SPACE@" ../kcl_ioctl.c
make CC=${CC} \
LIBIP_PREFIX=$(echo "$LIBIP_PREFIX" | sed -e 's|^\([^/]\)|../\1|') \
MODFLAGS="-DMODULE -DATI -DFGL -DPAGE_ATTR_FIX=$PAGE_ATTR_FIX -DCOMPAT_ALLOC_USER_SPACE=$COMPAT_ALLOC_USER_SPACE $def_smp $def_modversions" \
KVER=$kernelVersion \
KDIR=$kernelBuild \
PAGE_ATTR_FIX=$PAGE_ATTR_FIX \
-j4
cd $TMP
}
fi
{ # install
mkdir -p $out/lib/xorg
cp -r common/usr/include $out
cp -r common/usr/sbin $out
cp -r common/usr/share $out
mkdir $out/bin/
cp -f common/usr/X11R6/bin/* $out/bin/
# cp -r arch/$arch/lib $out/lib
# what are those files used for?
cp -r common/etc $out
cp -r $DIR_DEPENDING_ON_XORG_VERSION/usr/X11R6/$lib_arch/* $out/lib/xorg
# install kernel module
if test -z "$libsOnly"; then
t=$out/lib/modules/${kernelVersion}/kernel/drivers/misc
mkdir -p $t
cp ./common/lib/modules/fglrx/build_mod/2.6.x/fglrx.ko $t
fi
# should this be installed at all?
# its used by the example fglrx_gamma only
# don't use $out/lib/modules/dri because this will cause the kernel module
# aggregator code to see both: kernel version and the dri direcotry. It'll
# fail saying different kernel versions
cp -r $TMP/arch/$arch/usr/X11R6/$lib_arch/modules/dri $out/lib
cp -r $TMP/arch/$arch/usr/X11R6/$lib_arch/modules/dri/* $out/lib
cp -r $TMP/arch/$arch/usr/X11R6/$lib_arch/*.so* $out/lib
cp -r $TMP/arch/$arch/usr/X11R6/$lib_arch/fglrx/fglrx-libGL.so.1.2 $out/lib/fglrx-libGL.so.1.2
cp -r $TMP/arch/$arch/usr/$lib_arch/* $out/lib
ln -s libatiuki.so.1.0 $out/lib/libatiuki.so.1
ln -s fglrx-libGL.so.1.2 $out/lib/libGL.so.1
ln -s fglrx-libGL.so.1.2 $out/lib/libGL.so
# FIXME : This file is missing or has changed versions
#ln -s libfglrx_gamma.so.1.0 $out/lib/libfglrx_gamma.so.1
# make xorg use the ati version
ln -s $out/lib/xorg/modules/extensions/{fglrx/fglrx-libglx.so,libglx.so}
# Correct some paths that are hardcoded into binary libs.
if [ "$arch" == "x86_64" ]; then
for lib in \
xorg/modules/extensions/fglrx/fglrx-libglx.so \
xorg/modules/glesx.so \
dri/fglrx_dri.so \
fglrx_dri.so \
fglrx-libGL.so.1.2
do
oldPaths="/usr/X11R6/lib/modules/dri"
newPaths="/run/opengl-driver/lib/dri"
sed -i -e "s|$oldPaths|$newPaths|" $out/lib/$lib
done
else
oldPaths="/usr/X11R6/lib32/modules/dri\x00/usr/lib32/dri"
newPaths="/run/opengl-driver-32/lib/dri\x00/dev/null/dri"
sed -i -e "s|$oldPaths|$newPaths|" \
$out/lib/xorg/modules/extensions/fglrx/fglrx-libglx.so
for lib in \
dri/fglrx_dri.so \
fglrx_dri.so \
xorg/modules/glesx.so
do
oldPaths="/usr/X11R6/lib32/modules/dri/"
newPaths="/run/opengl-driver-32/lib/dri"
sed -i -e "s|$oldPaths|$newPaths|" $out/lib/$lib
done
oldPaths="/usr/X11R6/lib32/modules/dri\x00"
newPaths="/run/opengl-driver-32/lib/dri"
sed -i -e "s|$oldPaths|$newPaths|" $out/lib/fglrx-libGL.so.1.2
fi
# libstdc++ and gcc are needed by some libs
for pelib1 in \
fglrx_dri.so \
dri/fglrx_dri.so
do
patchelf --remove-needed libX11.so.6 $out/lib/$pelib1
done
for pelib2 in \
libatiadlxx.so \
xorg/modules/glesx.so \
dri/fglrx_dri.so \
fglrx_dri.so \
libaticaldd.so
do
patchelf --set-rpath $glibcDir/lib/:$libStdCxx/lib/ $out/lib/$pelib2
done
}
if test -z "$libsOnly"; then
{ # build samples
mkdir -p $out/bin
mkdir -p samples
cd samples
tar xfz ../common/usr/src/ati/fglrx_sample_source.tgz
eval "$patchPhaseSamples"
( # build and install fgl_glxgears
cd fgl_glxgears;
gcc -DGL_ARB_texture_multisample=1 -g \
-I$libGL/include -I$libGLU/include \
-I$out/include \
-L$libGL/lib -L$libGLU/lib -lGL -lGLU -lX11 -lm \
-o $out/bin/fgl_glxgears -Wall fgl_glxgears.c
)
true || ( # build and install
###
## FIXME ?
# doesn't build undefined reference to `FGLRX_X11SetGamma'
# which should be contained in -lfglrx_gamma
# This should create $out/lib/libfglrx_gamma.so.1.0 ? because there is
# a symlink named libfglrx_gamma.so.1 linking to libfglrx_gamma.so.1.0 in $out/lib/
cd programs/fglrx_gamma
gcc -fPIC -I${libXxf86vm.dev}/include \
-I${xorgproto}/include \
-I$out/X11R6/include \
-L$out/lib \
-Wall -lm -lfglrx_gamma -lX11 -lXext -o $out/bin/fglrx_xgamma fglrx_xgamma.c
)
{
# patch and copy statically linked qt libs used by amdcccle
patchelf --set-interpreter $(echo $glibcDir/lib/ld-linux*.so.2) $TMP/arch/$arch/usr/share/ati/$lib_arch/libQtCore.so.4 &&
patchelf --set-rpath $gcc/$lib_arch/ $TMP/arch/$arch/usr/share/ati/$lib_arch/libQtCore.so.4 &&
patchelf --set-rpath $gcc/$lib_arch/:$out/share/ati/:$libXrender/lib/:$libSM/lib/:$libICE/lib/:$libfontconfig/lib/:$libfreetype/lib/ $TMP/arch/$arch/usr/share/ati/$lib_arch/libQtGui.so.4 &&
mkdir -p $out/share/ati
cp -r $TMP/arch/$arch/usr/share/ati/$lib_arch/libQtCore.so.4 $out/share/ati/
cp -r $TMP/arch/$arch/usr/share/ati/$lib_arch/libQtGui.so.4 $out/share/ati/
# copy binaries and wrap them:
BIN=$TMP/arch/$arch/usr/X11R6/bin
patchelf --set-rpath $gcc/$lib_arch/:$out/share/ati/:$libXinerama/lib/:$libXrandr/lib/ $TMP/arch/$arch/usr/X11R6/bin/amdcccle
patchelf --set-rpath $libXrender/lib/:$libXrandr/lib/ $TMP/arch/$arch/usr/X11R6/bin/aticonfig
patchelf --shrink-rpath $BIN/amdcccle
for prog in $BIN/*; do
cp -f $prog $out/bin &&
patchelf --set-interpreter $(echo $glibcDir/lib/ld-linux*.so.2) $out/bin/$(basename $prog) &&
wrapProgram $out/bin/$(basename $prog) --prefix LD_LIBRARY_PATH : $out/lib/:$gcc/lib/:$out/share/ati/:$libXinerama/lib/:$libXrandr/lib/:$libfontconfig/lib/:$libfreetype/lib/${LD_LIBRARY_PATH:+:}$LD_LIBRARY_PATH
done
}
rm -f $out/lib/fglrx/switchlibglx && rm -f $out/lib/fglrx/switchlibGL
}
fi
for p in $extraDRIlibs; do
for lib in $p/lib/*.so*; do
ln -s $lib $out/lib/
done
done

View file

@ -1,140 +0,0 @@
{ stdenv, lib, fetchurl, kernel ? null, which
, xorg, makeWrapper, glibc, patchelf, unzip
, fontconfig, freetype, libGLU, libGL # for fgl_glxgears
, # Whether to build the libraries only (i.e. not the kernel module or
# driver utils). Used to support 32-bit binaries on 64-bit
# Linux.
libsOnly ? false
}:
assert (!libsOnly) -> kernel != null;
with lib;
# This derivation requires a maximum of gcc49, Linux kernel 4.1 and xorg.xserver 1.17
# and will not build or run using versions newer
# If you want to use a different Xorg version probably
# DIR_DEPENDING_ON_XORG_VERSION in builder.sh has to be adopted (?)
# make sure libglx.so of ati is used. xorg.xorgserver does provide it as well
# which is a problem because it doesn't contain the xorgserver patch supporting
# the XORG_DRI_DRIVER_PATH env var.
# See https://marc.info/?l=nix-dev&m=139641585515351 for a
# workaround (TODO)
# The gentoo ebuild contains much more "magic" and is usually a great resource to
# find patches XD
# http://wiki.cchtml.com/index.php/Main_Page
# /usr/lib/dri/fglrx_dri.so must point to /run/opengl-driver/lib/fglrx_dri.so
# This is done in the builder script.
stdenv.mkDerivation rec {
version = "15.12";
pname = "ati-drivers";
build = "15.302";
linuxonly =
if stdenv.hostPlatform.system == "i686-linux" then
true
else if stdenv.hostPlatform.system == "x86_64-linux" then
true
else throw "ati-drivers are Linux only. Sorry. The build was stopped.";
name = pname + "-" + version + (optionalString (!libsOnly) "-${kernelDir.version}");
builder = ./builder.sh;
gcc = stdenv.cc.cc;
libXinerama = xorg.libXinerama;
libXrandr = xorg.libXrandr;
libXrender = xorg.libXrender;
libXxf86vm = xorg.libXxf86vm;
xorgproto = xorg.xorgproto;
libSM = xorg.libSM;
libICE = xorg.libICE;
libfreetype = freetype;
libfontconfig = fontconfig;
libStdCxx = stdenv.cc.cc.lib;
src = fetchurl {
url =
"https://www2.ati.com/drivers/linux/radeon-crimson-15.12-15.302-151217a-297685e.zip";
sha256 = "704f2dfc14681f76dae3b4120c87b1ded33cf43d5a1d800b6de5ca292bb61e58";
curlOpts = "--referer https://www.amd.com/en/support";
};
hardeningDisable = [ "pic" "format" ];
patchPhaseSamples = "patch -p2 < ${./patches/patch-samples.patch}";
patches = [
./patches/15.12-xstate-fp.patch
./patches/15.9-kcl_str.patch
./patches/15.9-mtrr.patch
./patches/15.9-preempt.patch
./patches/15.9-sep_printf.patch ]
++ optionals ( kernel != null &&
(lib.versionAtLeast kernel.version "4.6") )
[ ./patches/kernel-4.6-get_user_pages.patch
./patches/kernel-4.6-page_cache_release-put_page.patch ]
++ optionals ( kernel != null &&
(lib.versionAtLeast kernel.version "4.7") )
[ ./patches/4.7-arch-cpu_has_pge-v2.patch ]
++ optionals ( kernel != null &&
(lib.versionAtLeast kernel.version "4.9") )
[ ./patches/4.9-get_user_pages.patch ];
nativeBuildInputs = [ unzip ];
buildInputs =
[ xorg.libXrender xorg.libXext xorg.libX11 xorg.libXinerama xorg.libSM
xorg.libXrandr xorg.libXxf86vm xorg.xorgproto xorg.imake xorg.libICE
patchelf
libGLU libGL
fontconfig
freetype
makeWrapper
which
];
inherit libsOnly;
kernelDir = if libsOnly then null else kernel.dev;
# glibc only used for setting the binaries interpreter
glibcDir = glibc.out;
# outputs TODO: probably many fixes are needed;
LD_LIBRARY_PATH = makeLibraryPath
[ xorg.libXrender xorg.libXext xorg.libX11 xorg.libXinerama xorg.libSM
xorg.libXrandr xorg.libXxf86vm xorg.xorgproto xorg.imake xorg.libICE
libGLU libGL
fontconfig
freetype
stdenv.cc.cc
];
# without this some applications like blender don't start, but they start
# with nvidia. This causes them to be symlinked to $out/lib so that they
# appear in /run/opengl-driver/lib which get's added to LD_LIBRARY_PATH
extraDRIlibs = [ xorg.libXrandr.out xorg.libXrender.out xorg.libXext.out
xorg.libX11.out xorg.libXinerama.out xorg.libSM.out
xorg.libICE.out ];
inherit libGLU libGL; # only required to build the examples
enableParallelBuilding = true;
meta = with lib; {
description = "ATI Catalyst display drivers";
homepage = "http://support.amd.com/us/gpudownload/Pages/index.aspx";
license = licenses.unfree;
maintainers = with maintainers; [ marcweber offline jerith666 ];
platforms = platforms.linux;
hydraPlatforms = [];
# Copied from the nvidia default.nix to prevent a store collision.
priority = 4;
};
}

View file

@ -1,26 +0,0 @@
From: Krzysztof Kolasa <kkolasa@winsoft.pl>
Date: Thu, 26 Nov 2015 14:28:46 +0100
Subject: [PATCH] Patch for kernel 4.4.0-rc2
constant change of name XSTATE_XP to name XFEATURE_MASK_FP
---
firegl_public.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/common/lib/modules/fglrx/build_mod/firegl_public.c b/common/lib/modules/fglrx/build_mod/firegl_public.c
index 3626c7b..f071d42 100644
--- a/common/lib/modules/fglrx/build_mod/firegl_public.c
+++ b/common/lib/modules/fglrx/build_mod//firegl_public.c
@@ -6463,7 +6463,11 @@ static int KCL_fpu_save_init(struct task_struct *tsk)
if (!(fpu->state->xsave.xsave_hdr.xstate_bv & XSTATE_FP))
#else
copy_xregs_to_kernel(&fpu->state.xsave);
- if (!(fpu->state.xsave.header.xfeatures & XSTATE_FP))
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,4,0)
+ if (!(fpu->state.xsave.header.xfeatures & XFEATURE_MASK_FP))
+#else
+ if (!(fpu->state.xsave.header.xfeatures & XSTATE_FP))
+#endif
#endif
return 1;
} else if (static_cpu_has(X86_FEATURE_FXSR)) {

View file

@ -1,14 +0,0 @@
--- a/common/lib/modules/fglrx/build_mod/kcl_str.c 2015-09-13 13:47:30.000000000 -0400
+++ b/common/lib/modules/fglrx/build_mod/kcl_str.c 2015-09-13 13:49:42.000000000 -0400
@@ -169,7 +169,11 @@ int ATI_API_CALL KCL_STR_Strnicmp(const
const char* s2,
KCL_TYPE_SizeSigned count)
{
+#if LINUX_VERSION_CODE < KERNEL_VERSION(4,0,0)
return strnicmp(s1, s2, count);
+#else
+ return strncasecmp(s1, s2, count);
+#endif
}
/** \brief Locate character in string

View file

@ -1,27 +0,0 @@
--- a/common/lib/modules/fglrx/build_mod/firegl_public.c 2015-09-19 23:43:22.000000000 -0400
+++ b/common/lib/modules/fglrx/build_mod/firegl_public.c 2015-09-19 23:52:07.000000000 -0400
@@ -3442,7 +3442,11 @@ int ATI_API_CALL KCL_MEM_MTRR_Support(vo
int ATI_API_CALL KCL_MEM_MTRR_AddRegionWc(unsigned long base, unsigned long size)
{
#ifdef CONFIG_MTRR
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,3,0)
+ return arch_phys_wc_add(base, size);
+#else
return mtrr_add(base, size, MTRR_TYPE_WRCOMB, 1);
+#endif
#else /* !CONFIG_MTRR */
return -EPERM;
#endif /* !CONFIG_MTRR */
@@ -3451,7 +3455,12 @@ int ATI_API_CALL KCL_MEM_MTRR_AddRegionW
int ATI_API_CALL KCL_MEM_MTRR_DeleteRegion(int reg, unsigned long base, unsigned long size)
{
#ifdef CONFIG_MTRR
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,3,0)
+ arch_phys_wc_del(reg);
+ return reg;
+#else
return mtrr_del(reg, base, size);
+#endif
#else /* !CONFIG_MTRR */
return -EPERM;
#endif /* !CONFIG_MTRR */

View file

@ -1,103 +0,0 @@
--- a/common/lib/modules/fglrx/build_mod/firegl_public.c 2015-08-30 17:36:02.000000000 -0400
+++ b/common/lib/modules/fglrx/build_mod/firegl_public.c 2015-08-30 17:39:36.000000000 -0400
@@ -21,6 +21,8 @@
!!! since it requires changes to linux/init/main.c.
#endif /* !MODULE */
+#include <linux/preempt.h>
+
// ============================================================
#include <linux/version.h>
@@ -4997,7 +4999,9 @@ static unsigned int kas_spin_unlock(kas_
unsigned long ATI_API_CALL KAS_GetExecutionLevel(void)
{
unsigned long ret;
+ preempt_disable();
ret = kas_GetExecutionLevel();
+ preempt_enable();
return ret;
}
@@ -5022,8 +5026,10 @@ unsigned int ATI_API_CALL KAS_Ih_Execute
KCL_DEBUG5(FN_FIREGL_KAS,"0x%08X, 0x%08X\n", ih_routine, ih_context);
//Prevent simultaneous entry on some SMP systems.
+ preempt_disable();
if (test_and_set_bit(0, (void *)&(kasContext.in_interrupts[smp_processor_id()])))
{
+ preempt_enable();
KCL_DEBUG1(FN_FIREGL_KAS, "The processor is handling the interrupt\n");
return IRQ_NONE;
}
@@ -5036,9 +5042,9 @@ unsigned int ATI_API_CALL KAS_Ih_Execute
kasSetExecutionLevel(orig_level);
spin_unlock(&kasContext.lock_ih);
-
clear_bit(0, (void *)&(kasContext.in_interrupts[smp_processor_id()]));
KCL_DEBUG5(FN_FIREGL_KAS,"%d\n", ret);
+ preempt_enable();
return ret;
}
@@ -5256,6 +5262,7 @@ unsigned int ATI_API_CALL KAS_Spinlock_A
KCL_DEBUG5(FN_FIREGL_KAS,"0x%08X\n", hSpinLock);
+ preempt_disable();
spin_lock_info.routine_type = spinlock_obj->routine_type;
spin_lock_info.plock = &(spinlock_obj->lock);
@@ -5263,6 +5270,7 @@ unsigned int ATI_API_CALL KAS_Spinlock_A
spinlock_obj->acquire_type = spin_lock_info.acquire_type;
spinlock_obj->flags = spin_lock_info.flags;
+ preempt_enable();
KCL_DEBUG5(FN_FIREGL_KAS,"%d\n", ret);
return ret;
@@ -6034,6 +6042,8 @@ unsigned int ATI_API_CALL KAS_Interlocke
KCL_DEBUG5(FN_FIREGL_KAS,"0x%08X, 0x%08X, 0x%08X\n", hListHead, hListEntry, phPrevEntry);
+ preempt_disable();
+
/* Protect the operation with spinlock */
spin_lock_info.routine_type = listhead_obj->routine_type;
spin_lock_info.plock = &(listhead_obj->lock);
@@ -6041,6 +6051,7 @@ unsigned int ATI_API_CALL KAS_Interlocke
if (!kas_spin_lock(&spin_lock_info))
{
KCL_DEBUG_ERROR("Unable to grab list spinlock\n");
+ preempt_enable();
return 0; /* No spinlock - no operation */
}
@@ -6065,6 +6076,7 @@ unsigned int ATI_API_CALL KAS_Interlocke
spin_unlock_info.flags = spin_lock_info.flags;
ret = kas_spin_unlock(&spin_unlock_info);
+ preempt_enable();
KCL_DEBUG5(FN_FIREGL_KAS,"%d", ret);
return ret;
}
@@ -6153,8 +6165,10 @@ unsigned int ATI_API_CALL KAS_Interlocke
spin_lock_info.routine_type = listhead_obj->routine_type;
spin_lock_info.plock = &(listhead_obj->lock);
+ preempt_disable();
if (!kas_spin_lock(&spin_lock_info))
{
+ preempt_enable();
KCL_DEBUG_ERROR("Unable to grab list spinlock");
return 0; /* No spinlock - no operation */
}
@@ -6178,6 +6192,7 @@ unsigned int ATI_API_CALL KAS_Interlocke
spin_unlock_info.flags = spin_lock_info.flags;
ret = kas_spin_unlock(&spin_unlock_info);
+ preempt_enable();
KCL_DEBUG5(FN_FIREGL_KAS,"%d", ret);
return ret;
}

View file

@ -1,11 +0,0 @@
--- a/common/lib/modules/fglrx/build_mod/firegl_public.c 2015-09-14 15:14:36.000000000 -0400
+++ b/common/lib/modules/fglrx/build_mod/firegl_public.c 2015-09-14 16:18:58.000000000 -0400
@@ -649,6 +649,8 @@ static int firegl_major_proc_read(struct
*eof = 1;
len = snprintf(buf, request, "%d\n", major);
+#elif LINUX_VERSION_CODE >= KERNEL_VERSION(4,3,0)
+ seq_printf(m, "%d\n", major);
#else
len = seq_printf(m, "%d\n", major);
#endif

View file

@ -1,70 +0,0 @@
diff -uNr 16.8/common/lib/modules/fglrx/build_mod/firegl_public.c 16.8b/common/lib/modules/fglrx/build_mod/firegl_public.c
--- 16.8/common/lib/modules/fglrx/build_mod/firegl_public.c 2015-12-18 19:47:41.000000000 +0100
+++ 16.8b/common/lib/modules/fglrx/build_mod/firegl_public.c 2016-08-15 15:09:37.228538907 +0200
@@ -4518,7 +4518,11 @@
write_cr0(cr0);
wbinvd();
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,7,0)
+ if (boot_cpu_has(X86_FEATURE_PGE))
+#else
if (cpu_has_pge)
+#endif
{
cr4 = READ_CR4();
WRITE_CR4(cr4 & ~X86_CR4_PGE);
@@ -4532,7 +4536,11 @@
wbinvd();
__flush_tlb();
write_cr0(cr0 & 0xbfffffff);
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,7,0)
+ if (boot_cpu_has(X86_FEATURE_PGE))
+#else
if (cpu_has_pge)
+#endif
{
WRITE_CR4(cr4);
}
@@ -4559,7 +4567,11 @@
write_cr0(cr0);
wbinvd();
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,7,0)
+ if (boot_cpu_has(X86_FEATURE_PGE))
+#else
if (cpu_has_pge)
+#endif
{
cr4 = READ_CR4();
WRITE_CR4(cr4 & ~X86_CR4_PGE);
@@ -4572,7 +4584,11 @@
wbinvd();
__flush_tlb();
write_cr0(cr0 & 0xbfffffff);
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,7,0)
+ if (boot_cpu_has(X86_FEATURE_PGE))
+#else
if (cpu_has_pge)
+#endif
{
WRITE_CR4(cr4);
}
diff -uNr 16.8/common/lib/modules/fglrx/build_mod/firegl_public.h 16.8b/common/lib/modules/fglrx/build_mod/firegl_public.h
--- 16.8/common/lib/modules/fglrx/build_mod/firegl_public.h 2015-12-18 19:47:41.000000000 +0100
+++ 16.8b/common/lib/modules/fglrx/build_mod/firegl_public.h 2016-08-15 15:09:05.815141238 +0200
@@ -650,9 +650,15 @@
#define cpu_has_pat test_bit(X86_FEATURE_PAT, (void *) &boot_cpu_data.x86_capability)
#endif
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,7,0)
+#ifndef boot_cpu_has(X86_FEATURE_PGE)
+#define boot_cpu_has(X86_FEATURE_PGE) test_bit(X86_FEATURE_PGE, &boot_cpu_data.x86_capability)
+#endif
+#else
#ifndef cpu_has_pge
#define cpu_has_pge test_bit(X86_FEATURE_PGE, &boot_cpu_data.x86_capability)
#endif
+#endif
/* 2.6.29 defines pgprot_writecombine as a macro which resolves to a
* GPL-only function with the same name. So we always use our own

View file

@ -1,28 +0,0 @@
commit b3e4353fc68a6a024dcb95e2d61aa0afd7370233
Author: Matt McHenry <matt@mchenryfamily.org>
Date: Fri Feb 3 20:19:41 2017
patch for 4.9 only
diff --git a/common/lib/modules/fglrx/build_mod/firegl_public.c b/common/lib/modules/fglrx/build_mod/firegl_public.c
index 4ce095f..3b591e1 100755
--- a/common/lib/modules/fglrx/build_mod/firegl_public.c
+++ b/common/lib/modules/fglrx/build_mod/firegl_public.c
@@ -3224,7 +3224,7 @@ int ATI_API_CALL KCL_LockUserPages(unsigned long vaddr, unsigned long* page_list
int ret;
down_read(&current->mm->mmap_sem);
- ret = get_user_pages(vaddr, page_cnt, 1, 0, (struct page **)page_list, NULL);
+ ret = get_user_pages(vaddr, page_cnt, 1, (struct page **)page_list, NULL);
up_read(&current->mm->mmap_sem);
return ret;
@@ -3242,7 +3242,7 @@ int ATI_API_CALL KCL_LockReadOnlyUserPages(unsigned long vaddr, unsigned long* p
int ret;
down_read(&current->mm->mmap_sem);
- ret = get_user_pages(vaddr, page_cnt, 0, 0, (struct page **)page_list, NULL);
+ ret = get_user_pages(vaddr, page_cnt, 0, (struct page **)page_list, NULL);
up_read(&current->mm->mmap_sem);
return ret;

View file

@ -1,25 +0,0 @@
diff --git a/common/lib/modules/fglrx/build_mod/firegl_public.c b/common/lib/modules/fglrx/build_mod/firegl_public.c
index 9c70211..b2242af 100755
--- a/common/lib/modules/fglrx/build_mod/firegl_public.c
+++ b/common/lib/modules/fglrx/build_mod/firegl_public.c
@@ -3220,7 +3220,7 @@ int ATI_API_CALL KCL_LockUserPages(unsigned long vaddr, unsigned long* page_list
int ret;
down_read(&current->mm->mmap_sem);
- ret = get_user_pages(current, current->mm, vaddr, page_cnt, 1, 0, (struct page **)page_list, NULL);
+ ret = get_user_pages(vaddr, page_cnt, 1, 0, (struct page **)page_list, NULL);
up_read(&current->mm->mmap_sem);
return ret;
@@ -3238,7 +3238,7 @@ int ATI_API_CALL KCL_LockReadOnlyUserPages(unsigned long vaddr, unsigned long* p
int ret;
down_read(&current->mm->mmap_sem);
- ret = get_user_pages(current, current->mm, vaddr, page_cnt, 0, 0, (struct page **)page_list, NULL);
+ ret = get_user_pages(vaddr, page_cnt, 0, 0, (struct page **)page_list, NULL);
up_read(&current->mm->mmap_sem);
return ret;
--
2.9.2

View file

@ -1,16 +0,0 @@
diff --git a/common/lib/modules/fglrx/build_mod/firegl_public.c b/common/lib/modules/fglrx/build_mod/firegl_public.c
index b2242af..586129c 100755
--- a/common/lib/modules/fglrx/build_mod/firegl_public.c
+++ b/common/lib/modules/fglrx/build_mod/firegl_public.c
@@ -3249,7 +3249,7 @@ void ATI_API_CALL KCL_UnlockUserPages(unsigned long* page_list, unsigned int pag
unsigned int i;
for (i=0; i<page_cnt; i++)
{
- page_cache_release((struct page*)page_list[i]);
+ put_page((struct page*)page_list[i]);
}
}
--
2.9.2

View file

@ -1,26 +0,0 @@
diff --git a/samples/fgl_glxgears/fgl_glxgears.c b/samples/fgl_glxgears/fgl_glxgears.c
index 6c8e313..2b8d035 100644
--- a/samples/fgl_glxgears/fgl_glxgears.c
+++ b/samples/fgl_glxgears/fgl_glxgears.c
@@ -1096,8 +1096,6 @@ static void event_loop(void)
view_rotx -= 5.0;
}
else {
- r = XLookupString(&event.xkey, buffer, sizeof(buffer),
- NULL, NULL);
if (buffer[0] == 27) {
/* escape */
return;
diff -Nur a/samples/fgl_glxgears/fgl_glxgears.c b/samples/fgl_glxgears/fgl_glxgears.c
--- a/samples/fgl_glxgears/fgl_glxgears.c 2012-08-29 09:59:03.000000000 +0300
+++ b/samples/fgl_glxgears/fgl_glxgears.c 2013-09-07 09:26:11.034723135 +0300
@@ -78,7 +78,6 @@
#endif // _WIN32
#define INT_PTR ptrdiff_t
-#include <GL/glATI.h>
#ifdef _WIN32
#include <GL/wglATI.h>

View file

@ -20365,7 +20365,7 @@ in
bbswitch = callPackage ../os-specific/linux/bbswitch {};
ati_drivers_x11 = callPackage ../os-specific/linux/ati-drivers { };
ati_drivers_x11 = throw "ati drivers are no longer supported by any kernel >=4.1"; # added 2021-05-18
chipsec = callPackage ../tools/security/chipsec {
inherit kernel;