Announcement

Collapse
No announcement yet.

How To Help Improve, Develop Mesa Drivers

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • How To Help Improve, Develop Mesa Drivers

    Phoronix: How To Help Improve, Develop Mesa Drivers

    If you aren't satisfied with seeing Mesa lag far behind the latest OpenGL standard and come up short when in the areas of performance and features compared to some of the proprietary graphics drivers, they always welcome additional help...

    http://www.phoronix.com/vr.php?view=MTE1NTY

  • #2
    Are any non devs here running mesa from git? Are the build instructions up to date (http://dri.freedesktop.org/wiki/Building)? I mean would I get it compiled on a vanilla Fedra 17 / Ubuntu 12.4 installation? Are there eventually scripts available (fetch and build) for the lazy ones?

    Comment


    • #3
      it's probably out of date (last change 2009).

      If you just want mesa there's no voodoo involved:

      Code:
      git clone git://anongit.freedesktop.org/mesa/mesa
      cd mesa
      ./autogen.sh --prefix=/usr --libdir=/usr/lib64 --with-gallium-drivers="<drivername>"
      make -jX
      make install (<-- this will overwrite your packages installed by your package manager, in case you want to use the result system wide)
      you may have to adjust the "--libdir" parameter and more config arguments are available to enable (experimental) features (see ./autogen.sh --help).

      Comment


      • #4
        Originally posted by log0 View Post
        Are any non devs here running mesa from git?
        Me.
        OK, I understand C language but I'm (sadly) incompetent to improve the drivers. That said, the R600Todo lists some "Easy" tasks, I think this is very interesting that experimented devs push more "Easy" tasks here so that we can at least try to understand the code with a point of entry. This is much more easy!

        Originally posted by log0 View Post
        Are the build instructions up to date (http://dri.freedesktop.org/wiki/Building)? I mean would I get it compiled on a vanilla Fedra 17 / Ubuntu 12.4 installation? Are there eventually scripts available (fetch and build) for the lazy ones?
        It looks mostly obsolete.
        In fact, this is very simple to compile a git driver. I wrote a tutorial (in french) in a Fedora-fr forum, I can translate it if someone wants.

        Comment


        • #5
          I suggest to use Arch linux. Here is PKGBUILD script for r300g and r600g :

          pkgname=mesa-full
          pkgver=20120807
          _realver=8.1
          pkgrel=1
          pkgdesc="Full Mesa 3D graphics library with all its components, built from the git master branch."
          arch=(i686 x86_64)
          url="http://mesa3d.org/"
          license=('LGPL')
          depends=('libdrm>=2.4.24' 'dri2proto>=2.6' 'glproto>=1.4.14' 'libxxf86vm' 'libxdamage' 'expat>=2.0.1' 'llvm')
          makedepends=('pkgconfig' 'imake')
          optdepends=('libtxc_dxtn: S3TC support'
          'mesa-demos: glxinfo and glxgears')
          provides=("mesa=${_realver}" "libgl=${_realver}" "libglapi=${_realver}" "libgles=${_realver}" "libegl=${_realver}" "ati-dri=${_realver}" "intel-dri=${_realver}" "nouveau-dri=${_realver}" "khrplatform-devel=${_realver}" "khrplatform=${_realver}")
          conflicts=('mesa' 'libgl' 'libglapi' 'libgles' 'libegl' 'ati-dri' 'intel-dri' 'nouveau-dri' 'mach64-dri' 'mga-dri' 'r128-dri' 'savage-dri' 'tdfx-dri' 'unichrome-dri' 'khrplatform-devel' 'khrplatfrom')

          _gitroot="git://anongit.freedesktop.org/git/mesa/mesa"
          _gitname="mesa"

          build() {
          msg "Connecting to the GIT server...."

          if [ -d $_gitname ] ; then
          cd $_gitname
          git pull origin
          cd ..
          else
          git clone $_gitroot --depth=1
          fi

          msg "Creating build directory..."
          rm -rf $_gitname-build
          cp -rH $_gitname $_gitname-build

          msg "Starting build..."
          cd $_gitname-build

          # Classic r300, r600 & swrast are disabled - their Gallium versions are better.
          # Classic nouveau is for different hardware than Gallium nouveau, so both are enabled.

          # For Wayland support use mesa-full-wayland, or:
          # - install libwayland-git
          # - add wayland to --with-egl-platforms

          # If you live in the US, you should delete --enable-texture-float \ line.

          ./autogen.sh --prefix=/usr --with-dri-driverdir=/usr/lib/xorg/modules/dri \
          --with-dri-drivers= \
          --with-gallium-drivers=r300,r600,swrast \
          --with-egl-platforms=x11,drm \
          --enable-gallium-llvm \
          --enable-gallium-egl \
          --disable-gallium-gbm \
          --enable-gallium-g3dvl \
          --enable-egl \
          --enable-gbm \
          --enable-xvmc \
          --enable-vdpau \
          --disable-debug \
          --enable-gles1 \
          --enable-gles2 \
          --enable-openvg \
          --enable-glx-tls \
          --enable-texture-float \
          --enable-shared-glapi \
          --disable-d3d1x

          make
          }

          package() {
          cd ${srcdir}/$_gitname-build

          make DESTDIR="${pkgdir}" install

          install -m755 -d "${pkgdir}/usr/lib/xorg/modules/extensions"
          ln -sf libglx.xorg ${pkgdir}/usr/lib/xorg/modules/extensions/libglx.so
          }

          Comment


          • #6
            Originally posted by whitecat View Post
            Me.
            ...
            In fact, this is very simple to compile a git driver. I wrote a tutorial (in french) in a Fedora-fr forum, I can translate it if someone wants.
            Would be great if you could do it.

            Btw Michael is compiling them regularly. How about a step by step article (maybe to draw enough attention to get the official wiki updated at least)?

            Comment


            • #7
              Originally posted by Tommy666 View Post
              I suggest to use Arch linux. Here is PKGBUILD script for r300g and r600g :
              ...
              Nice one, thanks. I am running Fedora/Ubuntu atm, but have played with arch a few years ago.

              Comment


              • #8
                Then there was this thread which died unfortunately (but not unexpected):

                Sponsor An Open Source Driver Dev

                Comment


                • #9
                  Originally posted by log0 View Post
                  Would be great if you could do it.

                  Btw Michael is compiling them regularly. How about a step by step article (maybe to draw enough attention to get the official wiki updated at least)?
                  In this this tutorial you will build the r600g driver (you can build other drivers too) so that you can use the upstream (git) driver without touching the Fedora driver. The compiled driver will be used only when you want. You can build the 64-bit driver for a 64-bit system, or the 32-bit driver for a 32-bit driver, and even a 32-bit driver for a 64-bit system (this is what you need in order to play 32-bit games like the awesone Enemy Territory: QUAKE Wars!!).

                  You must have in mind that I'm using Fedora 17 x86-64.
                  Also, currently, don't use the 3.5 kernel since there is some problem with r600g and it. Stay on the 3.4.6 for now.

                  STEP 1
                  ******

                  Retrieve all the packages needed for the compilation (valid for 32 and 64 bits):
                  # yum install gcc automake autoconf make makedepend gcc-c++ libtool flex bison git glibc-devel libX11-devel libdrm-devel libXfixes-devel libXdamage-devel libXext-devel expat-devel libudev-devel libXt-devel libXi-devel libXmu-devel udis86-devel libxcb-devel libxcb libXxf86vm libXxf86vm-devel glibc-devel.i686 libX11-devel.i686 libdrm-devel.i686 libXfixes-devel.i686 libXdamage-devel.i686 libXext-devel.i686 expat-devel.i686 libudev-devel.i686 libXt-devel.i686 libXi-devel.i686 libXmu-devel.i686 udis86-devel.i686 libxcb-devel.i686 libxcb.i686 libXxf86vm.i686 libXxf86vm-devel.i686

                  If you don't want to build the 32-bit driver, just delete all the *.i686 packages.

                  STEP 2
                  ******

                  Retrieve the Mesa source code from git:
                  $ git clone git://anongit.freedesktop.org/mesa/mesa

                  Later, when you want to get the updates, just perform:
                  $ cd mesa
                  $ git pull


                  STEP 3
                  ******

                  Case A) Prepare the compilation (build the 32-bit driver for 32-bit system OR 64-bit driver for 64-bit system)
                  $ cd mesa
                  $ ./autogen.sh --with-gallium-drivers=r600 --with-dri-drivers= CFLAGS="-O2" CXXFLAGS="-O2"


                  Case B) Prepare the compilation (build the 32-bit driver for 64-bit system, useful for 32-bit game)
                  $ cd mesa
                  $ ./autogen.sh --with-gallium-drivers=r600 --with-dri-drivers= --enable-32-bit CFLAGS="-O2 -m32" CXXFLAGS="-O2 -m32" --libdir=/usr/lib

                  You must understand that doing this you will replace the Fedora 32-bit driver (if it's installed). Don't be afraid ;-) The Fedora 64-bit driver is still here without modification.

                  Case A and B) Compilation:
                  $ make -j8

                  Case A and B) Last step, install the compiled driver in the final destination:
                  # make install

                  Now the GL library is installed in:
                  Case A) /usr/local/lib
                  Case B) /usr/lib

                  And the driver itself is in:
                  Case A) /usr/local/lib/dri
                  Case B) /usr/lib/dri

                  When you want to recompile, perform a:
                  $ make clean
                  and since some files are still not deleted (bug?), run:
                  $ cd mesa && find -name *.o -delete
                  and then replay the STEP 3 entirely.

                  If you need more information to compile another driver or enable some features for instance, look at:
                  $ ./autogen.sh --help

                  STEP 4
                  ******

                  If you want to play ETQW, you need the S3TC library. If you use Fedora, it's easy:
                  Enable the RPM Fusion repo and run:
                  # yum install libtxc_dxtn.i686 libtxc_dxtn.x86_64

                  STEP 5
                  ******

                  Now you can use your new driver like that (I launch ETQW in this example):
                  $ LD_LIBRARY_PATH="/usr/lib" LIBGL_DRIVERS_PATH="/usr/lib/dri" vblank_mode=0 /usr/local/games/etqw/etqw
                  Last edited by whitecat; 08-07-2012, 02:44 PM.

                  Comment


                  • #10
                    Originally posted by whitecat View Post
                    In this this tutorial you will build the r600g driver (you can build other drivers too) so that you can use the upstream (git) driver without touching the Fedora driver.
                    Exactly what I need. Will try asap.

                    If someone has got an Ubuntu build guide, please share.

                    Comment

                    Working...
                    X