summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuca Barbato <lu_zero@gentoo.org>2003-08-12 00:05:19 +0000
committerLuca Barbato <lu_zero@gentoo.org>2003-08-12 00:05:19 +0000
commit4809a2060fcd1d4fdee06b9d04756c558747a431 (patch)
treef359c770c2e3e3827330df3c216fa747c5fd8121 /media-video/ati-drivers
parentNew versions (diff)
downloadgentoo-2-4809a2060fcd1d4fdee06b9d04756c558747a431.tar.gz
gentoo-2-4809a2060fcd1d4fdee06b9d04756c558747a431.tar.bz2
gentoo-2-4809a2060fcd1d4fdee06b9d04756c558747a431.zip
New versions
Diffstat (limited to 'media-video/ati-drivers')
-rw-r--r--media-video/ati-drivers/ChangeLog11
-rw-r--r--media-video/ati-drivers/Manifest6
-rw-r--r--media-video/ati-drivers/ati-drivers-3.2.0.ebuild162
-rw-r--r--media-video/ati-drivers/ati-drivers-3.2.4.ebuild162
-rw-r--r--media-video/ati-drivers/files/digest-ati-drivers-3.2.01
-rw-r--r--media-video/ati-drivers/files/digest-ati-drivers-3.2.41
-rw-r--r--media-video/ati-drivers/files/fglrx-2.6-amd-adv-spec-fix.patch37
-rw-r--r--media-video/ati-drivers/files/fglrx-2.6-fix-deprecated.patch137
-rw-r--r--media-video/ati-drivers/files/fglrx-2.6-makefile.patch13
9 files changed, 526 insertions, 4 deletions
diff --git a/media-video/ati-drivers/ChangeLog b/media-video/ati-drivers/ChangeLog
index de8c5a099b83..36430d8276b5 100644
--- a/media-video/ati-drivers/ChangeLog
+++ b/media-video/ati-drivers/ChangeLog
@@ -1,6 +1,15 @@
# ChangeLog for media-video/ati-drivers
# Copyright 2002-2003 Gentoo Technologies, Inc.; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/media-video/ati-drivers/ChangeLog,v 1.13 2003/07/22 13:43:02 lu_zero Exp $
+# $Header: /var/cvsroot/gentoo-x86/media-video/ati-drivers/ChangeLog,v 1.14 2003/08/12 00:04:53 lu_zero Exp $
+
+*ati-drivers-3.2.4 (12 Aug 2003)
+
+*ati-drivers-3.2.0 (12 Aug 2003)
+
+ 12 Aug 2003 Luca Barbato <lu_zero@gentoo.org> ati-drivers-3.2.0.ebuild,
+ ati-drivers-3.2.4.ebuild, files/fglrx-2.6-amd-adv-spec-fix.patch,
+ files/fglrx-2.6-fix-deprecated.patch, files/fglrx-2.6-makefile.patch:
+ New versions, thanks to Wedge_ for the work.
22 Jul 2003 Luca Barbato <lu_zero@gentoo.org> ati-drivers-2.9.13-r1.ebuild,
ChangeLog: Added experimental support for 2.6 kernels.
diff --git a/media-video/ati-drivers/Manifest b/media-video/ati-drivers/Manifest
index fcad6ac1c1d7..8d35011299e0 100644
--- a/media-video/ati-drivers/Manifest
+++ b/media-video/ati-drivers/Manifest
@@ -1,13 +1,13 @@
MD5 6c813f947d953a426286ca6f11ad45de ati-drivers-2.9.13.ebuild 3655
-MD5 8d162d071d90f453004d7f8e1715cda5 ati-drivers-3.2.0.ebuild 4541
+MD5 39690003535cbb1298f6213bdd147bb7 ati-drivers-3.2.0.ebuild 4540
MD5 c68623abd4fbf8a5ddaa56b2bbfcd4c6 ati-drivers-2.9.12.ebuild 3654
MD5 1fa64133858500b621104b46d8e94b80 ati-drivers-2.9.13-r1.ebuild 4292
MD5 f5d5c52bb63599ec70ff6d5bdbc4ab27 ati-drivers-2.5.1-r1.ebuild 3735
MD5 9589e9577e2e9b5c8f846ead018931c7 ati-drivers-2.5.1.ebuild 3226
-MD5 cb2f07ca586d681480d5d4c4418fba98 ChangeLog 3012
+MD5 a74aa56f43c551e0a8f6c2cf1bd6c4c6 ChangeLog 3012
MD5 b478e8446636c1b2be60449a8e6f43bc ati-drivers-2.9.8.ebuild 3767
MD5 0502f917e7b43e4fdb170ae95b85961c ati-drivers-2.9.6.ebuild 3726
-MD5 219f47976cabe78023ad00e75084d5da ati-drivers-3.2.4.ebuild 4572
+MD5 60a036da1116be334c04e9eb5c1b9012 ati-drivers-3.2.4.ebuild 4571
MD5 caef37ecaa1695f1ffaaff60afb69b42 files/digest-ati-drivers-2.9.12 82
MD5 bb9dee9498a1b6e5d14476ae7194afc3 files/digest-ati-drivers-2.9.13 82
MD5 d7df82fba612188346e087bfc2a3a305 files/digest-ati-drivers-3.2.0 81
diff --git a/media-video/ati-drivers/ati-drivers-3.2.0.ebuild b/media-video/ati-drivers/ati-drivers-3.2.0.ebuild
new file mode 100644
index 000000000000..d39247fd7ade
--- /dev/null
+++ b/media-video/ati-drivers/ati-drivers-3.2.0.ebuild
@@ -0,0 +1,162 @@
+# Copyright 1999-2003 Gentoo Technologies, Inc.
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/media-video/ati-drivers/ati-drivers-3.2.0.ebuild,v 1.1 2003/08/12 00:04:53 lu_zero Exp $
+
+IUSE="qt kde gnome"
+
+DESCRIPTION="Ati precompiled drivers for r350, r300, r250 and r200 chipsets"
+HOMEPAGE="http://www.ati.com"
+SRC_URI="mirror://gentoo/fglrx-glc22-4.3.0-${PV}.i586.tar.gz"
+SLOT="${KV}"
+LICENSE="ATI GPL-2 QPL-1.0"
+KEYWORDS="-* ~x86"
+
+DEPEND=">=virtual/linux-sources-2.4
+ >=x11-base/xfree-4.3.0
+ qt? ( >=x11-libs/qt-3.0 )"
+
+RDEPEND="qt? ( >=x11-libs/qt-3.0 )"
+
+ATIBIN="${D}/opt/ati/bin"
+RESTRICT="nostrip"
+
+src_unpack() {
+ cd ${WORKDIR}
+ tar zxf ${DISTDIR}/fglrx-glc22-4.3.0-${PV}.i586.tar.gz || die
+ mkdir ${WORKDIR}/fglrxgears
+ cd ${WORKDIR}/fglrxgears
+ tar zxf ${WORKDIR}/usr/src/fglrx_sample_source.tgz || die
+ mv xc/programs/fgl_glxgears/* .
+ cp Makefile.Linux Makefile.Linux.orig || die
+ #defining USE_GLU allows this to compile with NVIDIA headers just fine
+ sed -e "s:-I/usr/X11R6/include:-D USE_GLU -I/usr/X11R6/include:" Makefile.Linux.orig > Makefile.Linux || die
+ cd ${WORKDIR}
+ local OLDBIN="/usr/X11R6/bin"
+ local ATIBIN="${D}/opt/ati/bin"
+ mkdir fglrx_panel
+ cd fglrx_panel
+ tar zxf ${WORKDIR}/usr/src/fglrx_panel_sources.tgz || die
+ sed -e "s:"${OLDBIN}":"${ATIBIN}":"\
+ Makefile >Makefile.new
+ mv Makefile.new Makefile
+}
+
+pkg_setup(){
+ check_KV || die "please ensure /usr/src/linux points to your kernel symlink"
+}
+
+
+src_compile() {
+ einfo "building the glx module"
+ cd ${WORKDIR}/lib/modules/fglrx/build_mod
+ if [ "`echo ${KV}|grep 2.6`" ] ; then
+ einfo "creating Makefile for kernel 2.6"
+ patch -p1 < ${FILESDIR}/fglrx-2.6-makefile.patch
+ einfo "applying fglrx-2.6-fix-deprecated.patch"
+ patch -p1 < ${FILESDIR}/fglrx-2.6-fix-deprecated.patch
+ einfo "applying fglrx-2.6-amd-adv-spec-fix.patch"
+ patch -p1 < ${FILESDIR}/fglrx-2.6-amd-adv-spec-fix.patch
+ GENTOO_ARCH=${ARCH} unset ARCH
+ addwrite "/usr/src/${FK}"
+ make -C /usr/src/linux SUBDIRS="`pwd`" modules || \
+ ewarn "glx module not built"
+ ARCH=${GENTOO_ARCH}
+ else
+ cd ${WORKDIR}/lib/modules/fglrx/build_mod
+ #that is the dirty way to avoid the id -u check
+ sed -e 's:`id -u`:0:' make.sh >make.sh.new
+ sed -e 's:`uname -r`:${KV}:' make.sh.new >make.sh
+ chmod +x make.sh
+ ./make.sh || ewarn "glx module not built"
+ fi
+
+ #that is the dirty way to avoid the id -u check
+ #sed -e 's:`id -u`:0:' make.sh >make.sh.new
+ #sed -e 's:`uname -r`:${KV}:' make.sh.new >make.sh
+ #chmod +x make.sh
+ #./make.sh || ewarn "glx module not built"
+
+ einfo "building the fgl_glxgears sample"
+ cd ${WORKDIR}/fglrxgears
+ make -f Makefile.Linux || ewarn "fgl_glxgears sample not build"
+
+ if [ "`use qt`" ]
+ then
+ einfo "building the qt fglx panel"
+ cd ${WORKDIR}/fglrx_panel
+ emake || die
+ fi
+ #removing stuff
+ einfo "cleaning"
+ cd ${WORKDIR}
+ rm -fR usr/share
+ cd usr/X11R6/
+ rm -fR bin/firegl*.bz2 bin/LICENSE.* bin/fgl_glxgears src
+}
+
+pkg_preinst() {
+# clean the dinamic libGL stuff's home to ensure
+# we dont have stale libs floating around
+ if [ -d ${ROOT}/usr/lib/opengl/ati ]
+ then
+ rm -rf ${ROOT}/usr/lib/opengl/ati/*
+ fi
+}
+
+src_install() {
+ local ATI_ROOT="/usr/lib/opengl/ati"
+ cd ${WORKDIR}
+
+#drm module
+ insinto /lib/modules/${KV}/video
+ if [ "`echo ${KV}|grep 2.6`" ] ; then
+ doins lib/modules/fglrx/build_mod/fglrx.ko
+ else
+ doins lib/modules/fglrx/build_mod/fglrx.o
+ fi
+
+#dri driver
+ exeinto ${ATI_ROOT}/lib
+ doexe usr/X11R6/lib/libGL.so.1.2
+ dosym libGL.so.1.2 ${ATI_ROOT}/lib/libGL.so.1
+ dosym libGL.so.1.2 ${ATI_ROOT}/lib/libGL.so
+ dosym libGL.so.1.2 ${ATI_ROOT}/lib/libMesaGL.so
+ #that is the same as in the xfree
+ dosym ../../xfree/lib/libGL.la ${ATI_ROOT}/lib/libGL.la
+
+#same as in xfree
+ exeinto ${ATI_ROOT}/
+ dosym ../xfree/include ${ATI_ROOT}/include
+ dosym ../xfree/extensions ${ATI_ROOT}/extensions
+ rm usr/X11R6/lib/libGL.so.1.2
+
+#apps
+ insinto /etc/env.d
+ doins ${FILESDIR}/09ati
+ exeinto /opt/ati/bin
+ doexe fglrxgears/fgl_glxgears
+ doexe usr/X11R6/bin/*
+ rm usr/X11R6/bin/*
+
+ if [ "`use qt`" ]
+ then
+ doexe fglrx_panel/fireglcontrol
+ fi
+ rm -f usr/src/*
+ cp -R usr ${D}
+}
+
+pkg_postinst() {
+ #Ebuild shouldn't do this automatically, just tell the user to do it: (drobbins, 1 May 2003)
+ #otherwise it messes up livecd/gamecd stuff
+ #if [ "${ROOT}" = "/" ]
+ #then
+ # /usr/sbin/opengl-update ati
+ #fi
+
+ einfo "To switch to ATI OpenGL, run \"opengl-update ati\""
+ einfo "To chance your XF86Config you can use the bundled \"fglrxconfig\""
+#drm-module
+ update-modules
+
+}
diff --git a/media-video/ati-drivers/ati-drivers-3.2.4.ebuild b/media-video/ati-drivers/ati-drivers-3.2.4.ebuild
new file mode 100644
index 000000000000..7640cc22c32c
--- /dev/null
+++ b/media-video/ati-drivers/ati-drivers-3.2.4.ebuild
@@ -0,0 +1,162 @@
+# Copyright 1999-2003 Gentoo Technologies, Inc.
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/media-video/ati-drivers/ati-drivers-3.2.4.ebuild,v 1.1 2003/08/12 00:04:53 lu_zero Exp $
+
+IUSE="qt kde gnome"
+
+DESCRIPTION="Ati precompiled drivers for r350, r300, r250 and r200 chipsets"
+HOMEPAGE="http://www.ati.com"
+SRC_URI="mirror://gentoo/fglrx-glc22-4.3.0-${PV}.i586.tar.gz"
+SLOT="${KV}"
+LICENSE="ATI GPL-2 QPL-1.0"
+KEYWORDS="-* ~x86"
+
+DEPEND=">=virtual/linux-sources-2.4
+ >=x11-base/xfree-4.3.0
+ qt? ( >=x11-libs/qt-3.0 )"
+
+RDEPEND="qt? ( >=x11-libs/qt-3.0 )"
+
+ATIBIN="${D}/opt/ati/bin"
+RESTRICT="nostrip"
+
+src_unpack() {
+ cd ${WORKDIR}
+ tar zxf ${DISTDIR}/fglrx-glc22-4.3.0-${PV}.i586.tar.gz || die
+ mkdir ${WORKDIR}/fglrxgears
+ cd ${WORKDIR}/fglrxgears
+ tar zxf ${WORKDIR}/usr/src/fglrx_sample_source.tgz || die
+ mv xc/programs/fgl_glxgears/* .
+ cp Makefile.Linux Makefile.Linux.orig || die
+ #defining USE_GLU allows this to compile with NVIDIA headers just fine
+ sed -e "s:-I/usr/X11R6/include:-D USE_GLU -I/usr/X11R6/include:" Makefile.Linux.orig > Makefile.Linux || die
+ cd ${WORKDIR}
+ local OLDBIN="/usr/X11R6/bin"
+ local ATIBIN="${D}/opt/ati/bin"
+ mkdir fglrx_panel
+ cd fglrx_panel
+ tar zxf ${WORKDIR}/usr/src/fglrx_panel_sources.tgz || die
+ sed -e "s:"${OLDBIN}":"${ATIBIN}":"\
+ Makefile >Makefile.new
+ mv Makefile.new Makefile
+}
+
+pkg_setup(){
+ check_KV || die "please ensure /usr/src/linux points to your kernel symlink"
+}
+
+
+src_compile() {
+ einfo "building the glx module"
+ cd ${WORKDIR}/lib/modules/fglrx/build_mod
+ if [ "`echo ${KV}|grep 2.6`" ] ; then
+ einfo "creating Makefile for kernel 2.6"
+ patch -p1 < ${FILESDIR}/fglrx-2.6-makefile.patch
+ einfo "applying fglrx-2.6-fix-deprecated.patch"
+ patch -p1 < ${FILESDIR}/fglrx-2.6-fix-deprecated.patch
+ einfo "applying fglrx-2.6-amd-adv-spec-fix.patch"
+ patch -p1 < ${FILESDIR}/fglrx-2.6-amd-adv-spec-fix.patch
+ GENTOO_ARCH=${ARCH} unset ARCH
+ addwrite "/usr/src/${FK}"
+ make -C /usr/src/linux SUBDIRS="`pwd`" modules || \
+ ewarn "glx module not built"
+ ARCH=${GENTOO_ARCH}
+ else
+ cd ${WORKDIR}/lib/modules/fglrx/build_mod
+ #that is the dirty way to avoid the id -u check
+ sed -e 's:`id -u`:0:' make.sh >make.sh.new
+ sed -e 's:`uname -r`:${KV}:' make.sh.new >make.sh
+ chmod +x make.sh
+ ./make.sh || ewarn "glx module not built"
+ fi
+
+ #that is the dirty way to avoid the id -u check
+ #sed -e 's:`id -u`:0:' make.sh >make.sh.new
+ #sed -e 's:`uname -r`:${KV}:' make.sh.new >make.sh
+ #chmod +x make.sh
+ #./make.sh || ewarn "glx module not built"
+
+ einfo "building the fgl_glxgears sample"
+ cd ${WORKDIR}/fglrxgears
+ make -f Makefile.Linux || ewarn "fgl_glxgears sample not build"
+
+ if [ "`use qt`" ]
+ then
+ einfo "building the qt fglx panel"
+ cd ${WORKDIR}/fglrx_panel
+ emake || die
+ fi
+ #removing stuff
+ einfo "cleaning"
+ cd ${WORKDIR}
+ rm -fR usr/share
+ cd usr/X11R6/
+ rm -fR bin/firegl*.bz2 bin/LICENSE.* bin/fgl_glxgears src
+}
+
+pkg_preinst() {
+# clean the dinamic libGL stuff's home to ensure
+# we dont have stale libs floating around
+ if [ -d ${ROOT}/usr/lib/opengl/ati ]
+ then
+ rm -rf ${ROOT}/usr/lib/opengl/ati/*
+ fi
+}
+
+src_install() {
+ local ATI_ROOT="/usr/lib/opengl/ati"
+ cd ${WORKDIR}
+
+#drm module
+ insinto /lib/modules/${KV}/video
+ if [ "`echo ${KV}|grep 2.6`" ] ; then
+ doins lib/modules/fglrx/build_mod/fglrx.ko
+ else
+ doins lib/modules/fglrx/build_mod/fglrx.o
+ fi
+
+#dri driver
+ exeinto ${ATI_ROOT}/lib
+ doexe usr/X11R6/lib/libGL.so.1.2
+ dosym libGL.so.1.2 ${ATI_ROOT}/lib/libGL.so.1
+ dosym libGL.so.1.2 ${ATI_ROOT}/lib/libGL.so
+ dosym libGL.so.1.2 ${ATI_ROOT}/lib/libMesaGL.so
+ #that is the same as in the xfree
+ dosym ../../xfree/lib/libGL.la ${ATI_ROOT}/lib/libGL.la
+
+#same as in xfree
+ exeinto ${ATI_ROOT}/
+ dosym ../xfree/include ${ATI_ROOT}/include
+ dosym ../xfree/extensions ${ATI_ROOT}/extensions
+ rm usr/X11R6/lib/libGL.so.1.2
+
+#apps
+ insinto /etc/env.d
+ doins ${FILESDIR}/09ati
+ exeinto /opt/ati/bin
+ doexe fglrxgears/fgl_glxgears
+ doexe usr/X11R6/bin/*
+ rm usr/X11R6/bin/*
+
+ if [ "`use qt`" ]
+ then
+ doexe fglrx_panel/fireglcontrol
+ fi
+ rm -f usr/src/*
+ cp -R usr ${D}
+}
+
+pkg_postinst() {
+ #Ebuild shouldn't do this automatically, just tell the user to do it: (drobbins, 1 May 2003)
+ #otherwise it messes up livecd/gamecd stuff
+ #if [ "${ROOT}" = "/" ]
+ #then
+ # /usr/sbin/opengl-update ati
+ #fi
+
+ einfo "To switch to ATI OpenGL, run \"opengl-update ati\""
+ einfo "To chance your XF86Config you can use the bundled \"fglrxconfig\""
+#drm-module
+ update-modules
+
+}
diff --git a/media-video/ati-drivers/files/digest-ati-drivers-3.2.0 b/media-video/ati-drivers/files/digest-ati-drivers-3.2.0
new file mode 100644
index 000000000000..954e49068d4f
--- /dev/null
+++ b/media-video/ati-drivers/files/digest-ati-drivers-3.2.0
@@ -0,0 +1 @@
+MD5 c3f2b428522bf299d34efe0acf2c5e7b fglrx-glc22-4.3.0-3.2.0.i586.tar.gz 3869336
diff --git a/media-video/ati-drivers/files/digest-ati-drivers-3.2.4 b/media-video/ati-drivers/files/digest-ati-drivers-3.2.4
new file mode 100644
index 000000000000..96806c602671
--- /dev/null
+++ b/media-video/ati-drivers/files/digest-ati-drivers-3.2.4
@@ -0,0 +1 @@
+MD5 378d8f4ab75d66d45093f2ae186fc00b fglrx-glc22-4.3.0-3.2.4.i586.tar.gz 3889628
diff --git a/media-video/ati-drivers/files/fglrx-2.6-amd-adv-spec-fix.patch b/media-video/ati-drivers/files/fglrx-2.6-amd-adv-spec-fix.patch
new file mode 100644
index 000000000000..24a09f64392b
--- /dev/null
+++ b/media-video/ati-drivers/files/fglrx-2.6-amd-adv-spec-fix.patch
@@ -0,0 +1,37 @@
+diff -Nurp ../fglrx-orig/build_mod/firegl_public.c build_mod/firegl_public.c
+--- ../fglrx-orig/build_mod/firegl_public.c 2003-07-11 11:42:06.000000000 +0000
++++ build_mod/firegl_public.c 2003-08-03 16:15:57.447117216 +0000
+@@ -3050,33 +3050,6 @@ static int __init have_cpuid_p(void)
+
+ int __ke_amd_adv_spec_cache_feature(void)
+ {
+- char vendor_id[16];
+- int ident;
+- int family, model;
+-
+- /* Must have CPUID */
+- if(!have_cpuid_p())
+- goto donthave;
+- if(cpuid_eax(0)<1)
+- goto donthave;
+-
+- /* Must be x86 architecture */
+- cpuid(0, &ident,
+- (int *)&vendor_id[0],
+- (int *)&vendor_id[8],
+- (int *)&vendor_id[4]);
+-
+- if (memcmp(vendor_id, "AuthenticAMD", 12))
+- goto donthave;
+-
+- ident = cpuid_eax(1);
+- family = (ident >> 8) & 0xf;
+- model = (ident >> 4) & 0xf;
+- if (((family == 6) && (model >= 6)) || (family == 15)) {
+- return 1;
+- }
+-
+-donthave:
+ return 0;
+ }
+
diff --git a/media-video/ati-drivers/files/fglrx-2.6-fix-deprecated.patch b/media-video/ati-drivers/files/fglrx-2.6-fix-deprecated.patch
new file mode 100644
index 000000000000..5f2cc41cefef
--- /dev/null
+++ b/media-video/ati-drivers/files/fglrx-2.6-fix-deprecated.patch
@@ -0,0 +1,137 @@
+diff -Nurp ../fglrx-orig/build_mod/agpgart_be.c build_mod/agpgart_be.c
+--- ../fglrx-orig/build_mod/agpgart_be.c 2003-07-11 11:42:06.000000000 +0000
++++ build_mod/agpgart_be.c 2003-08-03 16:14:20.259891920 +0000
+@@ -240,7 +240,7 @@ int agp_backend_acquire(void)
+ // don't increment our own module usage count, cause this
+ // would prevent the firegl kernel module from ever beeing unloaded.
+ // (agp_backend_release is called during module unload)
+- MOD_INC_USE_COUNT;
++ try_module_get(THIS_MODULE);
+ #endif // STANDALONE_AGPGART
+ return 0;
+ }
+@@ -252,7 +252,7 @@ void agp_backend_release(void)
+ }
+ atomic_dec(&agp_bridge.agp_in_use);
+ #ifdef STANDALONE_AGPGART
+- MOD_DEC_USE_COUNT;
++ module_put(THIS_MODULE);
+ #endif // STANDALONE_AGPGART
+ }
+
+@@ -368,7 +368,7 @@ static void agp_free_memory_phys_list(ag
+ agp_free_key(curr->key); // release the agp handle
+ vfree(curr->memory); // release the table with the phys adresses
+ kfree(curr); // release the agp_memory structure itself
+- MOD_DEC_USE_COUNT;
++ module_put(THIS_MODULE);
+ }
+
+ agp_memory *agp_allocate_memory_phys_list(
+@@ -398,13 +398,13 @@ agp_memory *agp_allocate_memory_phys_lis
+ * it
+ */
+
+- MOD_INC_USE_COUNT;
++ try_module_get(THIS_MODULE);
+
+ /* allocate a "new" agp_memory structure for the requested pages */
+ scratch_pages = (page_count + ENTRIES_PER_PAGE - 1) / ENTRIES_PER_PAGE;
+ new = agp_create_memory(scratch_pages);
+ if (new == NULL) {
+- MOD_DEC_USE_COUNT;
++ module_put(THIS_MODULE);
+ return NULL;
+ }
+ new->alloc_type = AGP_ALLOC_TYPE_PHYS_LIST;
+@@ -453,7 +453,7 @@ void agp_free_memory(agp_memory * curr)
+ agp_free_key(curr->key);
+ vfree(curr->memory);
+ kfree(curr);
+- MOD_DEC_USE_COUNT;
++ module_put(THIS_MODULE);
+ }
+
+ agp_memory *agp_allocate_memory(size_t page_count, u32 type)
+@@ -478,14 +478,14 @@ agp_memory *agp_allocate_memory(size_t p
+ * it
+ */
+
+- MOD_INC_USE_COUNT;
++ try_module_get(THIS_MODULE);
+
+ scratch_pages = (page_count + ENTRIES_PER_PAGE - 1) / ENTRIES_PER_PAGE;
+
+ new = agp_create_memory(scratch_pages);
+
+ if (new == NULL) {
+- MOD_DEC_USE_COUNT;
++ module_put(THIS_MODULE);
+ return NULL;
+ }
+ #ifdef FGL
+@@ -1566,7 +1566,7 @@ static agp_memory *intel_i810_alloc_by_t
+ new->page_count = pg_count;
+ new->num_scratch_pages = 0;
+ vfree(new->memory);
+- MOD_INC_USE_COUNT;
++ try_module_get(THIS_MODULE);
+ return new;
+ }
+ if(type == AGP_PHYS_MEMORY) {
+@@ -1583,7 +1583,7 @@ static agp_memory *intel_i810_alloc_by_t
+ if (new == NULL) {
+ return NULL;
+ }
+- MOD_INC_USE_COUNT;
++ try_module_get(THIS_MODULE);
+ new->memory[0] = agp_bridge.agp_alloc_page();
+
+ if (new->memory[0] == 0) {
+@@ -1614,7 +1614,7 @@ static void intel_i810_free_by_type(agp_
+ vfree(curr->memory);
+ }
+ kfree(curr);
+- MOD_DEC_USE_COUNT;
++ module_put(THIS_MODULE);
+ }
+
+ static unsigned long intel_i810_mask_memory(unsigned long addr, int type)
+@@ -1882,7 +1882,7 @@ static agp_memory *intel_i830_alloc_by_t
+
+ if (nw == NULL) return(NULL);
+
+- MOD_INC_USE_COUNT;
++ try_module_get(THIS_MODULE);
+ nw->memory[0] = agp_bridge.agp_alloc_page();
+ physical = nw->memory[0];
+ if (nw->memory[0] == 0) {
+diff -Nurp ../fglrx-orig/build_mod/firegl_public.c build_mod/firegl_public.c
+--- ../fglrx-orig/build_mod/firegl_public.c 2003-07-11 11:42:06.000000000 +0000
++++ build_mod/firegl_public.c 2003-08-03 16:14:20.261891616 +0000
+@@ -322,8 +322,8 @@ struct firegl_stub_info_t *firegl_stub_p
+ #define inter_module_get(x) firegl_stub_pointer
+ #define inter_module_register(x,y,z) do { firegl_stub_pointer = z; } while (0)
+ /* This is a kludge for backward compatibility that is only useful in DRM(stub_open) */
+-#define fops_put(fops) MOD_DEC_USE_COUNT
+-#define fops_get(fops) (fops); MOD_INC_USE_COUNT
++#define fops_put(fops) module_put(THIS_MODULE)
++#define fops_get(fops) (fops); try_module_get(THIS_MODULE)
+ #endif // LINUX_VERSION_CODE < 0x020400
+
+
+@@ -979,12 +979,12 @@ int __ke_error_code(enum __ke_error_num
+
+ void __ke_mod_inc_use_count(void)
+ {
+- MOD_INC_USE_COUNT;
++ try_module_get(THIS_MODULE);
+ }
+
+ void __ke_mod_dec_use_count(void)
+ {
+- MOD_DEC_USE_COUNT;
++ module_put(THIS_MODULE);
+ }
+
+ /*****************************************************************************/
diff --git a/media-video/ati-drivers/files/fglrx-2.6-makefile.patch b/media-video/ati-drivers/files/fglrx-2.6-makefile.patch
new file mode 100644
index 000000000000..fbdfdfcd3e2c
--- /dev/null
+++ b/media-video/ati-drivers/files/fglrx-2.6-makefile.patch
@@ -0,0 +1,13 @@
+diff -Nurp ../fglrx-orig/build_mod/Makefile build_mod/Makefile
+--- ../fglrx-orig/build_mod/Makefile 1970-01-01 00:00:00.000000000 +0000
++++ build_mod/Makefile 2003-08-03 16:18:54.592187072 +0000
+@@ -0,0 +1,9 @@
++#
++# Makefile for the drm device driver.
++# make -C /usr/src/linux SUBDIRS=`pwd` modules
++EXTRA_CFLAGS+=-DATI_AGP_HOOK -DATI -DFGL -DFGL_RX -DFGL_CUSTOM_MODULE -DFGL_LINUX253P1_VMA_API -D__AGP__
++##-Ipatch/include -Ipatch/driver/char/drm
++
++fglrx-objs := agpgart_be.o agp3.o i7505-agp.o nvidia-agp.o firegl_public.o libfglrx_ip.a.GCC3
++
++obj-m += fglrx.o