The Cube - Assimilating Technology

The Cube

DRI/OpenGL working on via epia unichrome

For Humans only


DRI/OpenGL working on via epia unichrome Print E-mail
Monday, 26 November 2007 20:24

This document describes what I had to do to get OpenGL and DRI to work on midgy, my HTPC. 

I recently split my HTPCS in front/backend. I upgraded my frontend to a new kernel (2.6.20), and removed all backend related items.

After the upgrade was completed, DRI and OpenGL no longer worked, even though I had the required modules loaded in kernel.
I remember having to compile/build all the Mesa/Drm/Dri stuff myself, last time I installed (about a year ago), but figured things had moved on by now.

Things did.

Kernel now includes the modules, so no longer need to patch the kernel to get via/unichrome modules loaded, but it seems DRI out-the-box still do not work with unichrome.

The DRI WIKI explains how to build from source, below is my version of it.

Using Gentoo.

Check for requirements, and install if not available.

  • proto/glproto 1.4.5
  • proto/xf86vidmode
  • proto lib/libXxf86vm
  • lib/libXmu
  • git

Get the latest source trees

mkdir /usr/src/dribuild
cd /usr/src/dribuild
git clone git://anongit.freedesktop.org/git/mesa/drm
git clone git://anongit.freedesktop.org/git/mesa/mesa
build/install libdrm
cd drm ./autogen.sh ./configure --prefix=/usr make install   (do this as root) 

build/install Mesa 3D

first edit /usr/src/dribuild/mesa/configs/linux-dri and set DRI_DIRS = "via"

cd  /usr/src/dribuild/mesa
make linux-dri
cp lib/*_dri.so /usr/lib/xorg/modules/dri/
cp lib/*_dri.so /usr/lib/xorg/dri/
cp lib/* /usr/lib
rm -rf /usr/lib/*_dri.so
build/install DRM
You need a configured kernel source tree installed.
DRM must either not be built, or built as a module
cat /usr/src/linux/.config |grep CONFIG_DRM
cd /usr/src/dribuild/drm/linux-core
make DRM_MODULES="via"
mkdir -p /lib/modules/2.6.20-suspend2-r6/kernel/drivers/char/drm
cp *.ko /lib/modules/2.6.20-suspend2-r6/kernel/drivers/char/drm
depmod -a
There seem to be a set of drm libs in /lib (gentoo drm install ?), older than the ones compiled above, so remove them, and symlink them to the new ones.
cd /lib
rm libdrm*
ln -s /usr/lib/libdrm.so.2.3.0 /lib/libdrm.so
ln -s /usr/lib/libdrm.so.2.3.0 /lib/libdrm.so.2
ln -s /usr/lib/libdrm.so.2.3.0 /lib/libdrm.so.2.0.0
ln -s /usr/lib/libdrm.la /lib/libdrm.la
Start xorg, then kill it, then check the logs
Startx
kill startx
cat /var/log/Xorg.0.log |grep -i drm


drmOpenDevice: node name is /dev/dri/card0
drmOpenDevice: open result is 6, (OK)
drmOpenDevice: node name is /dev/dri/card0
drmOpenDevice: open result is 6, (OK)
drmOpenByBusid: Searching for BusID PCI:1:0:0
drmOpenDevice: node name is /dev/dri/card0
drmOpenDevice: open result is 6, (OK)
drmOpenByBusid: drmOpenMinor returns 6
drmOpenByBusid: drmGetBusid reports pci:0000:01:00.0
(II) VIA(0): [drm] DRM interface version 1.3
(II) VIA(0): [drm] created "via" driver at busid "PCI:1:0:0"
(II) VIA(0): [drm] added 8192 byte SAREA at 0xf88f4000
(II) VIA(0): [drm] mapped SAREA 0xf88f4000 to 0xb5b2b000
(II) VIA(0): [drm] framebuffer handle = 0xd8000000
(II) VIA(0): [drm] added 1 reserved context for kernel
(II) VIA(0): [drm] register handle = 0xdc000000
(II) VIA(0): [drm] framebuffer handle = 0xd8000000
(II) VIA(0): [drm] mmio Registers = 0xdc000000
(II) VIA(0): [drm] Detected AGP vendor 0x1106, device 0x3123
(II) VIA(0): [drm] Didn't find any AGP v3 compatible device. Trying AGP 4X mode.
(II) VIA(0): [drm] Trying to enable AGP fast writes.
(II) VIA(0): [drm] drmAgpEnabled succeeded
(II) VIA(0): [drm] agpAddr = 0xd0000000
(II) VIA(0): [drm] agpBase = (nil)
(II) VIA(0): [drm] agpAddr = 0xd0000000
(II) VIA(0): [drm] agpSize = 0x01e00000
(II) VIA(0): [drm] agp physical addr = 0x00000000
(II) VIA(0): [drm] Using 29967520 bytes for DRM memory heap.
(II) VIA(0): [drm] installed DRM signal handler
(II) VIA(0): [drm] Irq handler installed, using IRQ 11.
(II) VIA(0): [drm] Initialized AGP ring-buffer, size 0x200000 at AGP offset 0x1e00000.
drmOpenDevice: node name is /dev/dri/card0
drmOpenDevice: open result is 7, (OK)
drmOpenByBusid: Searching for BusID PCI:1:0:0
drmOpenDevice: node name is /dev/dri/card0
drmOpenDevice: open result is 7, (OK)
drmOpenByBusid: drmOpenMinor returns 7
drmOpenByBusid: drmGetBusid reports pci:0000:01:00.0
(II) VIA(0): [drm] Cleaning up DMA ring-buffer.
(II) VIA(0): [drm] Freeing agp memory
(II) VIA(0): [drm] Releasing agp module
(II) VIA(0): [drm] removed 1 reserved context for kernel
(II) VIA(0): [drm] unmapping 8192 bytes of SAREA 0xf88f4000 at 0xb5b2b000
(II) VIA(0): [drm] Irq handler uninstalled.

cat /var/log/Xorg.0.log |grep DRI


(II) Loading extension XFree86-DRI
(II) VIA(0): [DRI] installation complete
(II) GLX: Initialized DRI GL provider for screen 0
Seems good, test
emerge mesa-progs (gives me glxgears)
startx
glxinfo |grep rendering
if it says yes, then all is well :)
Last Updated on Friday, 09 January 2009 07:59
 
Share on facebook