Announcement

Collapse
No announcement yet.

How To Help Improve, Develop Mesa Drivers

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

  • Hamish Wilson
    replied
    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. 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!!).
    Sorry to burst your bubble, but ET:QW is running for me fine on the stock Mesa and R600 Gallium3D drivers currently available for Fedora 16. Just make sure that r_useIndexBuffers is set to 1 in .etqwctl/base/etqwconfig.cfg and you should be golden.

    EDIT: Just saw that you only meant that you had to build a separate 32bit driver for playing certain 32bit games. My bad.
    Last edited by Hamish Wilson; 07 August 2012, 10:33 PM.

    Leave a comment:


  • 9a3eedi
    replied
    I am fairly proficient in C/C++ but I'm pretty sure that's not enough to get into Mesa development

    In general I always found it difficult to get into opensource development, but Mesa probably is even more difficult because of its low level nature.

    Leave a comment:


  • whitecat
    replied
    Originally posted by log0 View Post
    If someone has got an Ubuntu build guide, please share.
    Except the packages names in the STEP 1 and 4, it's the same.

    Leave a comment:


  • log0
    replied
    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.

    Leave a comment:


  • whitecat
    replied
    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; 07 August 2012, 02:44 PM.

    Leave a comment:


  • entropy
    replied
    Then there was this thread which died unfortunately (but not unexpected):

    Sponsor An Open Source Driver Dev

    Leave a comment:


  • log0
    replied
    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.

    Leave a comment:


  • log0
    replied
    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)?

    Leave a comment:


  • Tommy666
    replied
    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
    }

    Leave a comment:


  • whitecat
    replied
    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.

    Leave a comment:

Working...
X