XFree86/Xorg S3 Savage Duoview Support

Get the latest code here.

So having talked to a few people and dug around on the web a bit, I figured out the basics of how Duoview (sometimes called DuoVue) works on Savage chips. To the best of my knowledge it is only supported on the mobile versions (MX/IX and SuperSavage). I'm doing my development on an IBM T20 laptop, so I can only really test the Savage IX, although the MX and IX are really the same chip, the IX just has memory on the same package.

S3 debuted Duoview support on the Virge MX. I'd imagine Duoview works similarly on both, so if you have any information about the Virge MX, that might be helpful. If so I'd be happy to try and add duoview support to the Virge driver once I got it working on the Savage. I'm not sure if S3 required NDAs for the Virge databook, but they apparently do for the Savage.

My current work is against DRI cvs, however, my latest tarballs can be dropped into just about any X distro and should build fine.

If you have any questions about the driver or feel you might have something to contribute
(such as hardware or databooks :) ), send me email at agd5f (at) yahoo (d.o.t.) com.

Current Progress

2/24/2004 I've got the CRTCs and the dot clocks programmed correctly for each head, however, I can't seem to get a signal on the vga port. I suspect there is a bit somewhere that needs to be flipped to power up the vga port. If anyone knows more about this please let me know. I'd also like some info on how the streams regs and bitmap descriptors are dealt with on crtc2.
2/25/2004 I've narrowed the problem down to crtc2. All the dot clocks and outputs work fine, however nothing seems to work when connected to crtc2. Tests:

CRTC DCLK Output Result
---------------------------------------
crtc1 dclk1 FP/CRT/Both Works
crtc1 dclk2 FP/CRT/Both Works
crtc2 dclk1 FP/CRT/Both No signal
crtc2 dclk2 FP/CRT/Both No signal

To make sure I wasn't programming crtc2 wrong in my second head code path, I reworked the single head version of the driver with writes to the crtcs mirrored (mirrored writes, reads from crtc1). I verified the correct values were written to the regs in the register dumps. that way the same mode would be written to each controller. No dice.

7/8/2004 SUCCESS AT LAST! I can finally get crtc2 up! nothing more than a cloned desktop at the moment, but now that I have the modes working, the rest should come in time. latest code and binary here. Many thanks go out to Austin who helped me figure this out.

7/11/2004 Now that I've got crtc2 producing an image, I've got some new problems. I can't seem to change the framebuffer offset for crtc2. It's always locked at 0. Also the second hardware cursor doesn't seem to show up.

7/19/2004 I now have a working patch available for duoview. The patch is available here and is against DRI cvs (trunk). I've also provided a binary (compiled on redhat 8ish) and a sample XF86Config file here . I can only verify that it works on savage IX/MX, but it may also work on supersavages. As far as I know, mobile twister and prosavage chips only have 1 crtc. There are no dualhead desktop savage chips that I know of. If someone knows otherwise please let me know. TV out and s3switch will probably break duoview if you use it so be careful. The current support is something of a hack...a proof of concept if you will.

8/15/2004 New Patch. This new code ports over the recent changes from xorg cvs. The main change is the restructuing of the streams code in the addition of a new savage_streams.c,h. In addition to the patch you will need to download the savage_streams.c and h. Same problems still apply.

8/21/2004 Full MergedFB support for Savage. Grab the tarball here. I ported my radeon mergedfb code to savage. There are still a few bugs, but it works fine for the most part. Same problems with crtc2, hwcursor, etc. apply here as well. What does this mean? well, you now get xinerama support for apps that use it, and proper mode validation on both heads.

8/23/2004 A supersavage user has confirmed that duoview works on his laptop AND... CRTC2'S OFFSET MOVES! Hopefully I can figure out how supersavage is being set up differently that allows crtc2 to move. If not, then either MX/IX has an additional tweak I don't know about or the/my HW is slightly broken.

8/23/2004 CRTC2 problem is solved. CR65 does not need to be set on SavageIX/MX. New patches soon to follow.

8/23/2004 New tarball available. MergedFB works pretty well. I've also attempted to add support for "regular" multihead, although it doesn't really work right just yet. I'm not quite sure what the problem is. Xv also isn't quite working yet.

8/29/2004 New tarball available (savage-duo-full.tar.gz)! Just about everything now works: MergedFB and "xinerama" multi-head. Xv is untested, but probably broken (that's next on the block for fixin'). The console also gets hopelessly corrupted once dualhead has been enabled. Thanks again to Austin at S3/VIA! Without his help, none of this would have been possible. Also thanks to Ian McIntosh for testing and fixing a bug in the matchbiosmodes() output. Sample configs available here.

9/29/2004 I'm slowly merging the dualhead code into xorg. The first order of business is to merge "regular" dualhead then mergedfb. My initial patch for merging is available here.

9/30/2004 I committed my initial patch to xorg cvs last night along with some other clean ups.

10/13/2004 I committed some small fixes for supersavage users to xorg cvs last week. Also some supersavage users report problems with XaaScreenToScreenCopy on crtc2. If you experience that problem add the XaaNoScreenToScreenCopy option to your device config. At somepoint I'll get around to fixing it.

11/21/2004 Fixed HW cursor on crtc2. CR45 is shadowed. Xv on crtc2 is almost there. This and several other updates will be committed as soon as fd.o cvs is back up.

05/09/2005 Mark van Reijn reports that dualhead with tv-out works! Just set the the 'TvOnly' option in your second device section.

Xinerama Configuration notes
Same as other multi-head adaptors (Screen 0/Screen 1, etc.). Make sure you specify the same BusID for both device sections.

MergedFB Configuration notes
MergedFB is configured the same way as on sis and radeon.
See the updated man page here.

Current Status

Working
- Setting mode and refresh on crtc1 and 2
- Multi-head DRI in MergedFB mode (assuming you have an enough videoram)
- DPMS for both LCD and CRT
- TV out in conjuction with duoview

Not implemented (yet)
- Secondary streams on crtc2 (Xv) (in progress)
- Non-bios mode setting on crtc2


Links to other sites of note:

Tim Roberts' S3 Savage Webpage

Tim Roberts' S3 Savage Wiki

S3's Savage IX Webpage

DRI OpenGL Driver for Savage chipsets

Utah GLX OpenGL Driver for Savage chipsets

Other Stuff I'm working on

Xorg/XFree86 Dualhead Status