Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
TIP G400 DualHead and XFree/XOrg using matrox source
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks
View previous topic :: View next topic  
Author Message
gtaluvit
Tux's lil' helper
Tux's lil' helper


Joined: 09 Aug 2003
Posts: 135
Location: Columbia, MD

PostPosted: Tue Apr 13, 2004 1:51 pm    Post subject: TIP G400 DualHead and XFree/XOrg using matrox source Reply with quote

For a while I've been using XFree with the Matrox binary drivers for 4.3 inorder to run dual head. Only problem is that recently I've had issues with X freezing during OpenGL games and if I try to shutdown X forcing me to reboot and rebooting is bad :). As such, I finally found a way to get X working by compiling in the HAL with the source instead of using the binary only drivers. Here's how it works:

G400 DualHead in X from source

Changes:
    Made things pretty: 4-13-04


First, download the source mgadrivers-3.0-src.tgz from the Matrox website

Unpack the source to some directory.
Code:
tar zxvf mgadrivers-3.0-src.tgz


Now, start the emerge of xfree or xorg. It will download everything if necessary, do the md5 checksums, start patching, and generate a host.def file. Before it moves on to compilation, use Ctrl+Z to suspend the process.
Code:

gtaluvit root # emerge xorg-x11
Calculating dependencies ...done!
>>> emerge (1 of 1) x11-base/xorg-x11-6.7.0 to /
....
 * Done with patching
 * Setting up config/cf/host.def...
x86
!nls
!cjk                                                                      [ ok ]
>>> Source unpacked.


[1]+  Stopped                 emerge xorg-x11



We are now going to replace/edit source files so HAL gets included. Copy all the files from mgadrivers-3.0-src/4.3.0/drivers/src/HALlib to where the source for xfree/xorg is compiling. In my case, /var/tmp/portage/xorg-x11-6.7.0/work/xc/programs/Xserver/hw/xfree86/drivers/mga/HALlib
Code:

cp mgadrivers-3.0-src/4.3.0/drivers/src/HALlib/* /var/tmp/portage/xorg-x11-6.7.0/work/xc/programs/Xserver/hw/xfree86/drivers/mga/HALlib


Now we just need to make sure the makefiles will include them. Modify /var/tmp/portage/xorg-x11-6.7.0/work/xc/config/cf/host.def and find a line that states:
Code:
UseMatroxHal    NO
and change it to
Code:
UseMatroxHal    YES
HaveMatroxHal    YES


Now resume compilation using
Code:

gtaluvit root # fg
emerge xorg-x11
 * Building xorg-x11...
and you're ready for dualhead without using Matrox binary drivers!
_________________
I'm out of bed and dressed, what more do you want?
Back to top
View user's profile Send private message
radagast
Apprentice
Apprentice


Joined: 20 Mar 2004
Posts: 217
Location: sydney, .au

PostPosted: Mon May 24, 2004 4:24 am    Post subject: Reply with quote

i tried it. had to, cos i've got an AMD64 and i need to compile to 64bit.
i think the line that matters is the bold one.
i guess i'll do some more reading and ask in the AMD64 forum, and post the answer here when i find it...

making all in programs/Xserver/hw/xfree86/drivers...
make[5]: Entering directory `/var/tmp/portage/xfree-4.3.0-r5/work/xc/programs/Xserver/hw/xfree86/drivers'
making all in programs/Xserver/hw/xfree86/drivers/mga...
make[6]: Entering directory `/var/tmp/portage/xfree-4.3.0-r5/work/xc/programs/Xserver/hw/xfree86/drivers/mga'
rm -f mga_hal_drv.o
gcc -nostdlib -r mga_halmod.o clientlx.o HALlib/mgaHALlib.a -o mga_hal_drv.o
/usr/lib/gcc-lib/x86_64-pc-linux-gnu/3.3.3/../../../../x86_64-pc-linux-gnu/bin/ld: Relocatable linking with relocations from format elf32-i386 (HALlib/mgaHALlib.a(binding.o)) to format elf64-x86-64 (mga_hal_drv.o) is not supported
collect2: ld returned 1 exit status
make[6]: *** [mga_hal_drv.o] Error 1
...
!!! ERROR: x11-base/xfree-4.3.0-r5 failed.
!!! Function src_install, Line 636, Exitcode 2
!!! (no error message)
Back to top
View user's profile Send private message
gtaluvit
Tux's lil' helper
Tux's lil' helper


Joined: 09 Aug 2003
Posts: 135
Location: Columbia, MD

PostPosted: Thu May 27, 2004 4:00 am    Post subject: Reply with quote

Probably won't ever work for you. The lib from matrox is 32 bit for x86. That line looks like its trying to convert from 32bit to 64 and it won't let you. I can't help you there.
_________________
I'm out of bed and dressed, what more do you want?
Back to top
View user's profile Send private message
sl70
Guru
Guru


Joined: 18 Jun 2002
Posts: 387
Location: Chicago, USA

PostPosted: Thu Aug 12, 2004 4:19 pm    Post subject: Reply with quote

This has nothing to do with the AMD64 problem, but anyone rebuilding from source should note that the file {path-to-(xfree|xorg)-sources}/xc/programs/Xserver/hw/xfree86/drivers/mga/mga.h
has to be edited as well. There's a line in it that refers to
/opt/xc.430/programs/.... That should be changed to /var/tmp/portage/xfree-{version}/work/xc/... or it won't build.
Back to top
View user's profile Send private message
vood00
n00b
n00b


Joined: 07 Dec 2004
Posts: 1

PostPosted: Tue Dec 07, 2004 8:13 am    Post subject: Reply with quote

hey, nice howto, thanks.

works fine with xorg 6.8.0-r3 , matrox g550, lcd display and mgadriver-4.0-src too :-)
Back to top
View user's profile Send private message
tam
Guru
Guru


Joined: 04 Mar 2003
Posts: 569
Location: freiburg.de

PostPosted: Tue Dec 21, 2004 8:03 pm    Post subject: Reply with quote

vood00 wrote:
works fine with xorg 6.8.0-r3 , matrox g550, lcd display and mgadriver-4.0-src too :-)

I'm just trying with 4.1 sources
ftp://ftp.matrox.com/pub/mga/archive/linux/2004/mgadriver-4.1-1-src.tar.gz
Back to top
View user's profile Send private message
tam
Guru
Guru


Joined: 04 Mar 2003
Posts: 569
Location: freiburg.de

PostPosted: Tue Dec 21, 2004 8:36 pm    Post subject: Reply with quote

tam wrote:
I'm just trying with 4.1 sources

Cool! Works nice with 4.1 drivers and my G550. DVI and DRI ok, thanks gtaluvit for this howto.
Back to top
View user's profile Send private message
Manfred
n00b
n00b


Joined: 27 Apr 2004
Posts: 63

PostPosted: Wed Mar 15, 2006 2:04 pm    Post subject: using HALlib from source for Modular XOrg 7.0 Reply with quote

Anybody already managed DualHead (e.g.TwinView with G450 or G550) under Modular Xorg >= 7.0 ?
m.
Back to top
View user's profile Send private message
spitzwegerich
l33t
l33t


Joined: 04 Mar 2003
Posts: 697
Location: Lower Bavaria, Central Europe

PostPosted: Sat May 06, 2006 12:23 am    Post subject: Reply with quote

@Manfred:
There is a thread on the Matrox forum called G550 Moduler Xorg 7.0 and mga_hal working.
_________________
"Work is the curse of the drinking classes."
-Oskar Wilde
Back to top
View user's profile Send private message
Manfred
n00b
n00b


Joined: 27 Apr 2004
Posts: 63

PostPosted: Sun May 07, 2006 9:15 am    Post subject: Reply with quote

Thanks a lot for the hint.
But my problem was _not_ "7.0 and HAL", but "Dual Head".

One of the main differences between G550 and the earlier versions of the card is that the G550 does _not_ need HAL for DualHead.
Already with the monolithic server, DualHead was running fine without incorporating HAL.

But there seems to be some trouble with the initialization process; c.f.
https://bugs.freedesktop.org/show_bug.cgi?id=615#c17 and
http://forum.matrox.com/mga/viewtopic.php?p=97295#97295 .

In between, with the modular server, I am using the clean unpatched mga-1.4.1 code (Gentoo: x11-drivers/xf86-video-mga-1.4.1) straight away. Exploiting the "trick" to first (only once) start X in SingleView, afterwards TwinView works fine and absolutely stable.

Kind regards
Manfred


P.S. / Hint :

The G550 is also the very last of the Matrox cards that does _not_ need a proprietary driver.
Matrox has recently released a version with a "PCI Express x1 interface, compatible with all compliant PCI Express slots (PCIe x1, x4, x8, and x16)", c.f.
http://www.matrox.com/graphics/workstation/cre_pro/products/gseries/g550_PCIe.cfm .

The problem with the missing 64-bit source still remains -
and also the legal problems resulting from Matrox' license policy, hindering open-source developers of adapting by themselves; cf. eg.
http://forum.matrox.com/mga/viewtopic.php?t=12917 .
Back to top
View user's profile Send private message
spitzwegerich
l33t
l33t


Joined: 04 Mar 2003
Posts: 697
Location: Lower Bavaria, Central Europe

PostPosted: Sun May 07, 2006 1:48 pm    Post subject: Reply with quote

@Manfred:
You seem to know quite a bit about the mga driver, so I want to point you to the problem I currently have in the hope that you have some hint for me.

About 1 1/2 years ago, I got myself a G550 Dual DVI (AGP, with LFH60 connector) because I thought the driver is totally open source. When I found out about the closed sourced HAL library afterwards, I was quite disappointed.

I want to connect 2 DVI displays to my card (via the dual DVI cable plugged into the LFH60 connector) and use them in Xinerama mode. Does this require the HAL library?

With the 4.1 version of the mga driver + the HAL library, this was working perfectly until I updated to the 4.3 version of the driver.

Now, my setup only works with analog VGA connectors, but not with DVI. The details can be found in this thread.
_________________
"Work is the curse of the drinking classes."
-Oskar Wilde
Back to top
View user's profile Send private message
Swisside
n00b
n00b


Joined: 13 Feb 2005
Posts: 27

PostPosted: Sat Jan 20, 2007 10:28 am    Post subject: Reply with quote

Hey Guys, as you seem to know a lot about those mga drivers, could you help me with that:

https://forums.gentoo.org/viewtopic-t-533286-highlight-mga+xorg.html ???

Thanks in advance...
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum