Difference between revisions of "Building mesa with dri for fbcon"

From Organic Design wiki
(add links)
m
 
(22 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 
[[Category:OpenGL]][[Category:Peerix]]
 
[[Category:OpenGL]][[Category:Peerix]]
 +
=You will need=
 +
Sources:
 +
*libdrm-2.2
 +
*MesaLib-6.5.2
 +
*Kernel-2.6.16.18
 +
*libegl?
 +
 +
=Process=
 
The process requires both kernel space and user space software. You will need the kernel, the DRM/DRI and mesa source trees.
 
The process requires both kernel space and user space software. You will need the kernel, the DRM/DRI and mesa source trees.
 +
 +
==libdrm==
 +
These are the user space libs. Here is an example configure script to set some options for ''sandbox style'' compilation - where we don't want to install binaries on the host system. This is because we eventually want to cross compile for a target system.
  
 
I obtained the DRM source with git.
 
I obtained the DRM source with git.
Line 8: Line 19:
 
cd drm
 
cd drm
 
git clone git://anongit.freedesktop.org/git/mesa/drm
 
git clone git://anongit.freedesktop.org/git/mesa/drm
 +
 +
export ROOT=/home/rob/framebuffer/install
 +
cd drm
 +
./configure \
 +
--prefix=$ROOT/usr \
 +
--exec-prefix=$ROOT/usr \
 +
--bindir=$ROOT/usr/bin \
 +
--sbindir=$ROOT/usr/sbin \
 +
--libexecdir=$ROOT/usr/lib \
 +
--sysconfdir=$ROOT/etc \
 +
--datadir=$ROOT/usr/share \
 +
--localstatedir=$ROOT/var \
 +
--mandir=$ROOT/usr/man \
 +
--infodir=$ROOT/usr/info
 +
 +
make install
 +
</pre>
 +
 +
This create some files in ''/home/rob/framebuffer/install/usr/lib'', and others.
 +
 +
==Mesa==
 +
<pre>
 
cd
 
cd
 
mkdir mesa
 
mkdir mesa
 
cd mesa
 
cd mesa
 
cvs -d:pserver:anonymous@anoncvs.freedesktop.org:/cvs/mesa co Mesa
 
cvs -d:pserver:anonymous@anoncvs.freedesktop.org:/cvs/mesa co Mesa
cd
 
mkdir kernel
 
cd kernel
 
wget http://www.kernel.org/pub/linux/kernel/v2.6/linux-2.6.16.18.tar.bz2
 
tar xjf linux-2.6.16.18.tar.bz2
 
cd ~/drm/drm/linux-core
 
make LINUXDIR=~/kernel/linux-2.6.18/
 
 
</pre>
 
</pre>
 +
 +
Need to patch the config file to make it install things in our ''install'' directory
 +
<pre>
 +
cd Mesa
 +
export OD_INSTALL='/home/rob/framebuffer/install'
 +
export PKG_CONFIG_PATH="$OD_INSTALL/usr/lib/pkgconfig"
 +
sed -ri "s|INSTALL_DIR = .*$|INSTALL_DIR = $OD_INSTALL|" configs/default
 +
sed -ri "s|DRI_DRIVER_INSTALL_DIR = .*$|DRI_DRIVER_INSTALL_DIR = $OD_INSTALL" configs/default
 +
sed -ri "s|DRM_SOURCE_PATH=.*$|DRM_SOURCE_PATH = $OD_INSTALL/../drm|" configs/default
 +
make realclean
 +
</pre>
 +
 
All going well you will end up with a bunch of .o files in your ''~/drm/drm/linux-core'' directory.
 
All going well you will end up with a bunch of .o files in your ''~/drm/drm/linux-core'' directory.
  
 
Now you need to build mesa linking against these .o files.
 
Now you need to build mesa linking against these .o files.
 
<pre>
 
<pre>
cd ~/mesa/Mesa-6.5.1
+
cd ~/mesa/Mesa-6.5.2
make realclean
+
 
sed -ri 's|DRM_SOURCE_PATH.+$|DRM_SOURCE_PATH = ~/drm/drm/linux-core/|' configs/default
 
 
</pre>
 
</pre>
 
We need to edit the config to point to the DRM modules. And make it.
 
We need to edit the config to point to the DRM modules. And make it.
Line 33: Line 70:
 
</pre>
 
</pre>
  
==See also==
+
==dri==
 +
<pre>
 +
cd
 +
mkdir kernel
 +
cd kernel
 +
wget http://www.kernel.org/pub/linux/kernel/v2.6/linux-2.6.16.18.tar.bz2
 +
tar xjf linux-2.6.16.18.tar.bz2
 +
cd ~/drm/drm/linux-core
 +
make LINUXDIR=~/kernel/linux-2.6.18/
 +
</pre>
 +
 
 +
= See also =
 
*http://people.freedesktop.org/~ajax/dri-explanation.txt
 
*http://people.freedesktop.org/~ajax/dri-explanation.txt
 
*[[w:Direct Rendering Infrastructure|Direct Rendering Infrastructure]]
 
*[[w:Direct Rendering Infrastructure|Direct Rendering Infrastructure]]
 +
*[http://www.atomicmpc.com.au/forums.asp?s=2&c=16&t=1501 Building DRI]

Latest revision as of 08:17, 4 December 2006

You will need

Sources:

  • libdrm-2.2
  • MesaLib-6.5.2
  • Kernel-2.6.16.18
  • libegl?

Process

The process requires both kernel space and user space software. You will need the kernel, the DRM/DRI and mesa source trees.

libdrm

These are the user space libs. Here is an example configure script to set some options for sandbox style compilation - where we don't want to install binaries on the host system. This is because we eventually want to cross compile for a target system.

I obtained the DRM source with git.

cd
mkdir drm
cd drm
git clone git://anongit.freedesktop.org/git/mesa/drm

export ROOT=/home/rob/framebuffer/install
cd drm
./configure \
--prefix=$ROOT/usr \
--exec-prefix=$ROOT/usr \
--bindir=$ROOT/usr/bin \
--sbindir=$ROOT/usr/sbin \
--libexecdir=$ROOT/usr/lib \
--sysconfdir=$ROOT/etc \
--datadir=$ROOT/usr/share \
--localstatedir=$ROOT/var \
--mandir=$ROOT/usr/man \
--infodir=$ROOT/usr/info

make install

This create some files in /home/rob/framebuffer/install/usr/lib, and others.

Mesa

cd
mkdir mesa
cd mesa
cvs -d:pserver:anonymous@anoncvs.freedesktop.org:/cvs/mesa co Mesa

Need to patch the config file to make it install things in our install directory

cd Mesa
export OD_INSTALL='/home/rob/framebuffer/install'
export PKG_CONFIG_PATH="$OD_INSTALL/usr/lib/pkgconfig"
sed -ri "s|INSTALL_DIR = .*$|INSTALL_DIR = $OD_INSTALL|" configs/default
sed -ri "s|DRI_DRIVER_INSTALL_DIR = .*$|DRI_DRIVER_INSTALL_DIR = $OD_INSTALL" configs/default
sed -ri "s|DRM_SOURCE_PATH=.*$|DRM_SOURCE_PATH = $OD_INSTALL/../drm|" configs/default
make realclean

All going well you will end up with a bunch of .o files in your ~/drm/drm/linux-core directory.

Now you need to build mesa linking against these .o files.

cd ~/mesa/Mesa-6.5.2

We need to edit the config to point to the DRM modules. And make it.

make linux-solo

dri

cd
mkdir kernel
cd kernel
wget http://www.kernel.org/pub/linux/kernel/v2.6/linux-2.6.16.18.tar.bz2
tar xjf linux-2.6.16.18.tar.bz2
cd ~/drm/drm/linux-core
make LINUXDIR=~/kernel/linux-2.6.18/

See also