# New ATI 3.7.6 linux drivers

## gen2newB

The drivers are out, anyone care to work on an ebuild?

----------

## gen2newB

```

# Copyright 1999-2003 Gentoo Technologies, Inc.

# Distributed under the terms of the GNU General Public License v2

# $Header: /home/cvsroot/gentoo-x86/media-video/ati-drivers/ati-drivers-3.7.0.ebuild,v 1.2 2003/12/30 21:37:28 azarah Exp $

IUSE="qt kde gnome"

inherit eutils rpm

DESCRIPTION="Ati precompiled drivers for r350, r300, r250 and r200 chipsets"

HOMEPAGE="http://www.ati.com"

SRC_URI="http://www2.ati.com/drivers/linux/fglrx-4.3.0-3.7.6.i386.rpm"

SLOT="${KV}"

LICENSE="ATI GPL-2 QPL-1.0"

KEYWORDS="x86"

DEPEND=">=virtual/linux-sources-2.4

   app-arch/rpm2targz

   >=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() {

   local OLDBIN="/usr/X11R6/bin"

   cd ${WORKDIR}

   rpm_src_unpack

   mkdir -p ${WORKDIR}/extra

   einfo "Unpacking fglrx_sample_source.tgz..."

   tar --no-same-owner -C ${WORKDIR}/extra/ -zxf \

      ${WORKDIR}/usr/src/ATI/fglrx_sample_source.tgz \

      || die "Failed to unpack fglrx_sample_source.tgz!"

   # 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:" \

      -i ${WORKDIR}/extra/fgl_glxgears/Makefile.Linux || die

   mkdir -p ${WORKDIR}/extra/fglrx_panel

   einfo "Unpacking fglrx_panel_sources.tgz..."

   tar --no-same-owner -C ${WORKDIR}/extra/fglrx_panel/ -zxf \

      ${WORKDIR}/usr/src/ATI/fglrx_panel_sources.tgz \

      || die "Failed to unpack fglrx_panel_sources.tgz!"

   sed -e "s:"${OLDBIN}":"${ATIBIN}":"\

      -i ${WORKDIR}/extra/fglrx_panel/Makefile

   # Messed up fglrx_panel headers

   cd ${WORKDIR}/extra/fglrx_panel

   epatch ${FILESDIR}/fglrx-3.7.0-fix-fglrx_panel-includes.patch

   cd ${WORKDIR}/lib/modules/fglrx/build_mod

#   epatch ${FILESDIR}/fglrx-3.2.8-fix-amd-adv-spec.patch

#   if [ "`echo ${KV}|grep 2.6`" ]

#   then

#      epatch ${FILESDIR}/fglrx-2.6-vmalloc-vmaddr.patch

#      epatch ${FILESDIR}/fglrx-2.6-iminor.patch

#      epatch ${FILESDIR}/3.2.5-linux-2.6.0-test6-mm.patch

#   fi

}

pkg_setup(){

   check_KV || \

      die "Please ensure /usr/src/linux points to your kernel symlink!"

}

src_compile() {

   local GENTOO_ARCH=

   einfo "Building the DRM module..."

   cd ${WORKDIR}/lib/modules/fglrx/build_mod

   if [ "${KV}" != "${KV/2\.6}" ]

   then

      GENTOO_ARCH=${ARCH}

      unset ARCH

       addwrite "/usr/src/${FK}"

       cp 2.6.x/Makefile .

      export _POSIX2_VERSION="199209"

      make -C /usr/src/linux SUBDIRS="`pwd`" modules || \

         ewarn "DRM module not built"

       ARCH=${GENTOO_ARCH}

   else

      export _POSIX2_VERSION="199209"

      # That is the dirty way to avoid the id -u check

      sed -e 's:`id -u`:0:' \

         -e 's:`uname -r`:${KV}:' \

         -i make.sh

      ./make.sh || ewarn "DRM module not built"

   fi

   einfo "Building the fgl_glxgears sample..."

   cd ${WORKDIR}/extra/fgl_glxgears

   make -f Makefile.Linux || ewarn "fgl_glxgears sample not build!"

   if [ "`use qt`" ]

   then

      einfo "Building the QT fglx panel..."

      cd ${WORKDIR}/extra/fglrx_panel

      emake || die

   fi

   # Removing unused stuff

   rm -rf ${WORKDIR}/usr/X11R6/bin/{*.bz2,fgl_glxgears}

}

pkg_preinst() {

   # Clean the dinamic libGL stuff's home to ensure

   # we don't 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 [ "${KV}" != "${KV/2\.6}" ]

   then

      doins ${WORKDIR}/lib/modules/fglrx/build_mod/fglrx.ko

   else

      doins ${WORKDIR}/lib/modules/fglrx/build_mod/fglrx.o

   fi

   # OpenGL libs

   exeinto ${ATI_ROOT}/lib

   doexe ${WORKDIR}/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

   # This is the same as that of xfree ...

   dosym ../../xfree/lib/libGL.la ${ATI_ROOT}/lib/libGL.la

   # X and DRI driver

   exeinto /usr/X11R6/lib/modules/drivers

   doexe ${WORKDIR}/usr/X11R6/lib/modules/drivers/fglrx_drv.o

   exeinto /usr/X11R6/lib/modules/dri

   doexe ${WORKDIR}/usr/X11R6/lib/modules/dri/fglrx_dri.so

   rm -f ${WORKDIR}/usr/X11R6/lib/modules/drivers/fglrx_drv.o \

      ${WORKDIR}/usr/X11R6/lib/modules/dri/fglrx_dri.so

   # Same as in xfree

   exeinto ${ATI_ROOT}/

   dosym ../xfree/include ${ATI_ROOT}/include

   dosym ../xfree/extensions ${ATI_ROOT}/extensions

   rm -f ${WORKDIR}/usr/X11R6/lib/libGL.so.1.2

   # Apps

   insinto /etc/env.d

   doins ${FILESDIR}/09ati

   exeinto /opt/ati/bin

   doexe ${WORKDIR}/extra/fgl_glxgears/fgl_glxgears

   doexe ${WORKDIR}/usr/X11R6/bin/*

   rm -f ${WORKDIR}/usr/X11R6/bin/*

   if [ "`use qt`" ]

   then

      doexe ${WORKDIR}/extra/fglrx_panel/fireglcontrol

      # Fix the paths in these

      sed -e 's|/usr/X11R6/|/opt/ati/|g' \

         -i ${WORKDIR}/usr/share/applnk/fireglcontrol.kdelnk \

         -i ${WORKDIR}/usr/share/gnome/apps/fireglcontrol.desktop

   else

      # Removing unused stuff

      rm -rf ${WORKDIR}/usr/share/{applnk,gnome,icons,pixmaps}

   fi

   dodoc ${WORKDIR}/usr/share/doc/fglrx/LICENSE.*

   # Removing unused stuff

   rm -rf ${WORKDIR}/usr/{src,share/doc}

   cp -R ${WORKDIR}/usr ${D}/

}

pkg_postinst() {

# Ebuild shouldn't do this automatically, just tell the user to do it,

# otherwise it messes up livecd/gamecd stuff ...  (drobbins, 1 May 2003)

#   if [ "${ROOT}" = "/" ]

#   then

#      /usr/sbin/opengl-update ati

#   fi

   echo

   einfo "To switch to ATI OpenGL, run \"opengl-update ati\""

   einfo "To change your XF86Config you can use the bundled \"fglrxconfig\""

   echo

   # DRM module

   update-modules

}

```

I decided to take a stab at it. Its basically the ebuild for 3.7.0, but with the 3.2.8 patch taken out. Im gonna test it right now. Any other brave takers?

*Update*

This ebuild works, just gotta do a digest on the ebuild and it is good to go.

 *Quote:*   

> 
> 
> 16575 frames in 5.0 seconds = 3315.000 FPS
> 
> 20427 frames in 5.0 seconds = 4085.400 FPS
> ...

 

Those are my glxgears scores. The slumps in the score was from me loading a big image.

----------

## Vadatajs

Thanks, it worked for me.  It wanted to install development-sources-2.6.4_rc1 as a dependency though. I don't really see why it needs this over the 2.6.3 I'm currently running.  

ut2003 was noticably slower than 3.2.8, but I didn't notice any other issues in the few minutes I spent playing with it.  ut2004demo has also taken a big hit.

EDIT: These are crap.  See the rage3d thread below.  I went back to 3.2.8.

----------

## geoffs

ya, my radeon 8500 took a big hit in fps for glxgears.

----------

## Moled

getting what these ppl are getting?

http://www.rage3d.org/board/showthread.php?&threadid=33746855

----------

## apumarco

i just finished a new, 1st working, gentoo install in my system (I didn't even emerge xfree or other things) and, well, I'm new too linux. I would like to know how to install the new ati drivers, I downloaded the *.rpm from ATI, how do I make the ebuild?

At the moment I dont have internet access with gentoo so I have to copy everything with WinXP to a FAT32 partition and then install it.

for any help, specially code listing, i would be really thankful!

----------

## nomore

just do an "emerge ati-drivers" or have a look at http://www.gentoo.org/doc/en/ati-faq.xml

----------

## mr.isomer

OMG these drivers suck. even at 800x600 in UT2004Demo the thing beraly makes it smooth... 

How can i go back to the old drivers?????

----------

## Wedge_

If you want 3.2.8 back do: 

```
emerge =ati-drivers-3.2.8
```

----------

## Pink

These new ones work brilliantly, full recognition of my 9800xt (I removed the chipid line in my XFconfig file that made it think it is a 9800).

Much better glxgears (over 1000 better) and 250 more on fgl_glxgears (now 980 - 1000). I know these are not great benchmarks but everything I use 3d for on Linux is much better.

I must hang my head in shame as I got the xt for gaming in windows (  :Embarassed:  ) , so everything is fine for me.

As an interest point I have the nvidia agp compiled in to my kernel (not a module) and have never had a problem.

----------

