Note: this directory is simply a rendezvous for files related to current discussions. For more general Matt Dillon stuff go to my home page at APOLLO.
Making the EPIA EM 6000 and M 9000 "via" video driver work on FreeBSD-4.x
NOTE! New Information! XFree86 has started incorporating a CLE266 driver (the video chipset that the EM-6000 and M-9000 both use), but as of this writing the driver is only in the development snapshots. I still had problems getting it to work with my boxes under FreeBSD, though, and I had to make two modifications. First, I had to rewrite a portion of the VIAddc1Read() function in the xv/programs/Xserver/hw/xfree86/drivers/via/via_driver.c file, which I include below. Second, I had to turn on Option "SWCursor" in the XF86Config file (else the X server crashed on startup).
static unsigned int VIAddc1Read(ScrnInfoPtr pScrn) { register vgaHWPtr hwp = VGAHWPTR(pScrn); VIAPtr pVia = VIAPTR(pScrn); register CARD8 tmp; #if 0 while (hwp->readST01(hwp)&0x8) {}; while (!(hwp->readST01(hwp)&0x8)) {}; #endif usleep(10000); VGAOUT8(0x3c4, 0x26); tmp = VGAIN8(0x3c5); return ((unsigned int) ((tmp & 0x08) >> 3)); }
(This is the older information, which you can ignore now I hope):
libddmpeg.so
via_drv.o
libddmpeg.c (not required)
mk script (not required)
VIA-supplied drivers from their CD (not required)
The EPIA M 9000 motherboard comes with a VIA CD which has working drivers for Windows and Linux. Unfortunately they are in binary form. In particular, getting X11 to work requires these via-supplied drivers and VIA did not stick to the OS-independant ABI for XFree86. The via-supplied driver does not work out of the box on FreeBSD.
The problem is that when you try to use the supplied via_drv.o (I took the one out via's RedHat/7.3 tree and threw it into /usr/X11R6/lib/modules/drivers), it fails trying to load libddmpeg.so. Ok, so we copy the libddmpeg.so file from VIA's RedHat/7.3 tree into /usr/X11R6/lib/modules and try again. Now it fails trying to dynamically load libc.so.6. This presents a quandry because XFree on FreeBSD is, of course, a native compile, and the only libc.so.6 we have is from the linux emulation code, so we can't just throw it in there (nor would we want to).
My solution was to munge the libddmpeg.so in the most aweful hack you can imagine. Surgery, really. VIA provides the libddmpeg.a, so I wrote a little script and C program to pull out the symbols required and regenerate a shared library without any dependancies on libc.so.6. The libddmpeg.so file supplied above is the result.
WARNING! The above libddmpeg.so file represents a lobotomization of the VIA-supplied libddmpeg. It will allow you to run high resolution X video modes using the via supplied driver, but the X server may crash or otherwise do bad things if you actually try to use the MPeg extension (if it's even possible). The VIA driver will still complain a lot looking for linuxisms like /dev/video, but it *does* seem to work on my EPIA M 9000 in high resolution modes.
Installation: Download libddmpeg.so and via_drv.o. Copy libddmpeg.so to /usr/X11R6/lib/modules and copy via_drv.o to /usr/X11R6/lib/modules/drivers. Adjust your XFree86Config file (usually in /etc/X11 or /etc) to use the "via" driver.
Keywords for Google: XFree86 XFree X11 X via via_drv.o libddmpeg ddmpeg EPIA M 9000 VIA S3 CastleRock Graphics Video