Howto fix 20" G5 iMac display shift with nv Debian
Here's a quickie on how to manually compile the nv driver for the 20" G5 iMac that has a slight shift to the right. It's in the nv driver, and the bug for us, is actually a fix for others. Here's how I took out that "feature". :)
You'll need to apt-get install build-essential and fakeroot first.
Pull up the terminal, and su to root. Change directories somewhere else if you like.
1) apt-get source xserver-xorg-video-nv (get the nv source)
2) apt-get build-dep xserver-xorg-video-nv (gets the build-dependencies)
3) Now, edit out the offending lines in the nv_dac.c source. (do the fix specific to the G5 iMac)
A) cd xserver-xorg-video-nv-2.1.10/src
B) Edit nv_dac.c and remove these two lines:
if(pNv->Architecture == NV_ARCH_30) horizTotal += 2;
C) Optionally, you can change the default GCC compiler flags to something a bit more specific in the rules file in the debian directory. Here is what I use for /xserver-xorg-video-nv-2.1.10/debian/rules file:
CFLAGS = -mcpu=G5 -pipe -fsigned-char -maltivec -mabi=altivec -ftree-vectorize
(Note: beware of -mabi (EQUALS) altivec ... don't use -mabi-altivec (hyphen) - you'll tear your hair out.)
4) Change back to the /xserver-xorg-video-nv-2.1.10 directory.
From there issue:
dpkg-buildpackage -rfakeroot -uc -b
(note the "r" in rfakeroot)
Now if you look in the parent directory, you'll find your xserver-xorg-video-nv-2.1.10_powerpc.deb package!
Install it:
dpkg -i xserver-xorg-video-nv-2.1.10_powerpc.deb
Restart X, and you should be good to go! Just remember that you'll probably want to "pin" this package, so it won't get automatically updated for you! Or, if using Synaptic, be careful that on your next update, you'll end up reinstalling the "original" debian package! Uncheck it if you see it!
There is probably a better way to do this, as I'm not an expert at source packaging. And a big thanks to the team at Crux-ppc for some rocking CFLAG and CXXFLAG optimizations as seen in the GCC docs.