|
|
#1 | |
|
Registered User
Join Date: Jul 2005
Location: Munich
Posts: 910
|
Introduction
For a triple head setup where two displays are configured as TwinView, the Xinerama extension doesn't provide convenient information to applications. This post provides a quick&dirty hack to that problem. What's actually the problem? Let's assume two 1600x1200 LCDs are connected to a video card and are configured as TwinView (Screen 0). A third 1600x1200 LCD is connected to a second video card (Screen 1). When you now configure a single Xinerama screen, then the Xinerama Extension reports two screens: Screen 0 with 3200x1200 and screen 1 with 1600x1200. This might be ok for certain environments, but users typically would prefer to have three screens reported with 1600x1200 each. This is the behaviour for a Xinerama setup with three screens (in that case, two screens are defined for the first video card rather than using TwinView). So why not configuring three seperate screens, instead? Dragging a window amongst screens causes refresh events for the window when it is "between" screens. This is typically not a problem for "simple" applications, but may cause an annoying performence drop for Firefox and OpenOffice. TwinView can avoid that problem, at least for the first two screens. Depending on your working habits, this might reduce the annoyance factor by a magnitude (but when applying TwinView, then the wrong Xinerama Information is suppied). How to optain correct Xinerama information with TwinView? For a dual-head TwinView setup, the nvidia graphics driver provides it's own Xinerama extension, but when adding a third display with a second video card using Xinerama, then the Xinerama extension of the X-server is used, instead (loosing the Xinerama information for TwinView). The cleanest way to get back that information would probably be to modifiy the X-server to provide the correct information to the clients. However, this doesn't seem to be a truely easy task - and nobody seems to have it done, yet :-) A way more simpler variant is to modify the function XineramaQueryScreens() in the library libXinerama.so to provide the desired ("faked") Xinerama information, instead. Please note that the current patch does only take triple-head setups with equaly sized displays into account! However, this is typically the most common case anyway. The patch is very simple to understand and XineramaQueryScreens() can be easily modified to fit your very special needs if realy necessary. It is planned that the "faked" Xinerama information can be fully configurable in xorg.conf in future releases of the patch. The patch has not yet been heavily tested, but seems to work pretty nice. Installation Instructions Please find below the installation instructions for Fedora Core 6 (Xorg 7.1) and Fedora Core 4 (Xorg 6.8.2). However These procedures should be easily applyable to other distributions. Fedora Core 6 1. Download and unpack the libXinerama sources Code:
wget http://ftp.gwdg.de/pub/x11/x.org/pub/X11R7.1/src/lib/libXinerama-X11R7.0-1.0.1.tar.bz2 tar -xjf libXinerama-X11R7.0-1.0.1.tar.bz2 Code:
cd libXinerama-X11R7.0-1.0.1 patch src/Xinerama.c < ../Xinerama-3displays.diff ./configure make Code:
mv /usr/lib/libXinerama.so.1.0.0 /usr/lib/libXinerama.so.1.0.0-orig cp src/.libs/libXinerama.so.1.0.0 /usr/lib/ Fedora Core 4 1. Download and unpack the Xorg sources Code:
wget http://ftp.gwdg.de/pub/x11/x.org/pub/X11R6.8.2/src-single/X11R6.8.2-src.tar.bz2 tar -xjf X11R6.8.2-src.tar.bz2 Code:
cd xc/lib/Xinerama patch Xinerama.c < ../../../Xinerama-3displays.diff gcc -O2 -shared -o libXinerama.so.1.0 Xinerama.c ../Xext/extutil.c ../Xext/globals.c Code:
mv /usr/X11R6/lib/libXinerama.so.1.0 /usr/X11R6/lib/libXinerama.so.1.0-orig cp libXinerama.so.1.0 /usr/X11R6/lib/ to /etc/X11/gdm/gdm.conf in order to get the login prompted on the center display (I couldn't yet easily figure out how to do that for FC6). Feedback is highly appreciated! regards Bernhard |
|
|
|
|
|
|
#2 | |
|
Registered User
Join Date: Jul 2005
Location: Munich
Posts: 910
|
Hi, again!
While testing, i recongnized that xine is not working correctly with the patch above. It seems to be important to keep the Xserver locking/unlocking code in XineramaQueryScreens(). Please find an updated patch, that fixes that issue, attached. regards Bernhard |
|
|
|
|
|
|
#3 |
|
Quadro4
Join Date: Aug 2002
Location: USA
Posts: 63
|
First of all, I would like to thank and congratulate you for taking on this task. I have teh exact same setup you describe, I only wish that my job would let me have enough free time to jump in and help here
![]() Anyway, I wanted to ask you: have you tested your patched setup with Beryl ? Sounds like this might give me the solution to running 3 screens + Beryl. |
|
|
|
|
|
#4 | |
|
Registered User
Join Date: Jul 2005
Location: Munich
Posts: 910
|
Quote:
composite extension enabled which causes problems with xinerama: http://www.nvnews.net/vbulletin/showthread.php?t=78843 regards Bernhard |
|
|
|
|
|
|
#5 | |
|
Registered User
Join Date: Jul 2005
Location: Munich
Posts: 910
|
Quote:
Fedora Core 4: the situation is that the quick&dirty compilation as described above doesn't apply the right compiler flags. So for Xorg-6.8.2, you need to run a full build ("make World") to make this effect going away. regards Bernhard |
|
|
|
|
|
|
#6 | |
|
Quadro4
Join Date: Aug 2002
Location: USA
Posts: 63
|
Actually, I have used Beryl with Composite extension enabled. The problem is the 3 monitors setup. Since I have to activate the server Xorg Xinerama (not the Twinview one) to make the 3 monitors act as one, the RandR gets disabled. This RandR is required by Beryl. Is there was a way of having 3 monitors, 1 desktop, withour server Xinerama that would be perfect...
So for now, I can use Beryl and lose 1 monitor... or use 3 monitors without fancy 3D effects. Lose-lose situation for me. |
|
|
|
|
|
|
#7 | |
|
Registered User
Join Date: Jul 2005
Location: Munich
Posts: 910
|
Quote:
However, i just did a Code:
find beryl -name "*.c" | xargs grep XRR only used to query the refresh rate of connected displays and to notify the windowmanager when a display has been attached or detached. So i guess you could easily get rid of Xrandr in Beryl. regards Bernhard |
|
|
|
|
|
|
#8 |
|
Quadro4
Join Date: Aug 2002
Location: USA
Posts: 63
|
Exactly my thought ! I might actually try patching it, inspired by your code diving.
|
|
|
|
|
|
#9 | |
|
Registered User
Join Date: Jul 2005
Location: Munich
Posts: 910
|
Quote:
patched beryl still works with the usual setup. But when xinerama is enabled, in addScreen(), the call to glXMakeCurrent() fails without generating any of the defined error messages (see man page) and the sub-sequent call to glGetString() causes a crash! The parameters passed to glXMakeCurrent() look reasonable. glXMakeCurrent() is part of nvidia's libGL.so, so it will be pretty hard to track down the problem ... regards Bernhard |
|
|
|
|
|
|
#10 |
|
Registered User
Join Date: Jul 2005
Location: Munich
Posts: 910
|
Faked Xinerama Information in xorg.conf
This patch for the Xserver will allow the user to manualy define xinerama information in the xorg configuration file (/etc/X11/xorg.conf). This is very usefull for i.e. triple-head setups where the first two displays are running in twinview mode and thus forming a single screen in a xinerama setup (which is typically not what the user desires). This can also be very helpfull if you have a truely big single display and you want to artifically sub-devide it into smaller areas, so that when maximizing a window, it will not maximize to the whole display. The patch introduces a new option "XineramaInfo" for the server layout section. The parameter of this option is a comma seperated list of feked screen information of the form Code:
<width>x<height>+<x-offset>+<y-offset> Here is an example entry for a 4800x1200 triple-head setup with three 1600x1200 displays: Code:
Section "ServerLayout" [...] Option "XineramaInfo" "1600x1200+0+0,1600x1200+1600+0,1600x1200+3200+0" EndSection with xorg-x11-server-1.1.1-47.5, but the patch also applies for the vanilla xorg-7.1 package and should also work for other distributions. Limitations For the time being, only 16 faked screens can be defined. Installation instructions 1) Install the source RPM package and prepare the build directory Code:
rpm -i /tmp/xorg-x11-server-1.1.1-47.5.fc6.src.rpm cd /usr/src/redhat/SPECS rpmbuild -bc xorg-x11-server.spec 2) Apply the patch and build the Xserver Code:
cd /usr/src/redhat/BUILD/xorg-server-1.1.1/ patch -p1 < /tmp/patch-xorg-server-X11R7.1-1.1.0-xineramainfo make clean make 3) Install the Xserver binary Code:
cd hw/xfree86/ strip Xorg chmod u+s Xorg chmod go-r Xorg mv /usr/bin/Xorg /usr/bin/Xorg.fc6 cp Xorg /usr/bin Bernhard |
|
|
|
|
|
#11 |
|
Registered User
Join Date: Mar 2007
Posts: 8
|
I'm looking forward to testing that...
currently running gentoo with xorg 1.1.1-r4 |
|
|
|
|
|
#12 |
|
Registered User
Join Date: Nov 2006
Posts: 4
|
Your patch is just great !!! Thank you very much for this. So far it's working nicelly on my layout (AGP with 2 panels and PCI with one).
Next step would be to have XRandR working again (this for beryl) or waiting for beryl correct multi-head implementation. Anyway it is fast again (comparing to 3 screens without twinview) and I'm really happy about that. Thanks again. |
|
|
|
![]() |
| Thread Tools | |
|
|