Newbie questions about driver programming and s3 968 docs.

Martijn Uffing mp3project at
Thu Mar 9 14:21:27 PST 2006

On Thu, 9 Mar 2006, Luc Verhaegen wrote:

> On Thu, Mar 09, 2006 at 09:35:05PM +0100, Martijn Uffing wrote:
> > Ave people
> > 
> > 
> > I've got a Diamond Stealth 64 VRAM card with a s3 968 graphics chip and a 
> > TI Viewpoint 3026 Ramdac. This card doesn't work in Xorg because there's 
> > support for the s3 968, there's support for the TI 3026 Ramdac, but 
> > there's no support for the combination ....... yet. This is an old 
> > card so the chance that somebody will fix it is very small. Therefore in 
> > the open source spirit, I'll give it a try myself :)
> > 
> Smashing. Another person who's willing to do this kind of work.
After using open source for quite a time, it's time to give something 
back :)

> > However since I didn't even know what a ramdac was a week ago, I've got 
> > some newbie questions.
> > 
> > 
> > 1)The 3026 ramdac is supported in the mga driver. The s3 968 is supported 
> > in the s3 driver, but with a 3025 ramdac.
> > 
> > Does it matter for graphic chip programming which ramdac is connected? In 
> > other words: If I can get the 3026 working, will the 968/3026 combo just 
> > work(TM). Or do I also have to make changes in the s3 driver, beyond 
> > letting the s3 driver also probing for a 3026 ramdac and setting the 
> > pS3->DacPreInit/pS3->DacInit etc etc functions?
> > 
> > 
> > 2)The 3026 ramdac is supported in the mga driver. However there's also a 
> > generic ramdac module which has support for the 3026. Which one is the 
> > best to look at for guidance?
> > At this moment, I'm trying to duplicate the S3TiDAC(which are for the 
> > 3025) functions with S3TiDac_3026 equivalents.
> > 

> Don't. Adapt 3025 in the s3 driver to 3026. Might boil down to just an ID
> byte.
That was my initial thought also. Just an id byte, however I compared the 
3025 and 3026 docs and the've got a different register layout, different 
formulas for N,M,P dot clock programming. Still the 3026 
looks a lot like the 3025. So for now, I'm at least cloning the DacProbe 

> Don't go for modules for the ramdacs. The ramdacs themselves are trivial,
> and there is little point in modularisation.
I will implement the 3026 in the s3 driver files.

> ramdacs are very very simple devices. The only trouble is getting to talk
> to them. That involves things like setting the clock register in a
> peculiar way, and or poking DAC_READ/WRITE/MASK addressen in a specific
> fashion. This is all pretty much black magic that is both ramdac and
> chip specific.
> You have 3025, you're probably already able to talk to a 3026. Test this.
> If this works, you're pretty much done already. :)

> > 3)I've got docs for the 3025/3026. (kuddos to Texas Instruments for 
> > keeping docs online for long obsolete products!). I couldn't find docs 
> > for the s3 968. Of course I can look into the source of the XFree3/Xorg4 
> > drivers, and just copy paste some stuff.  But I would rather now WHAT the 
> > driver is doing by poking some registers. Especially how to reach the
> > direct registers of the ramdac. 
> > 
> > Example:
> > The s3 driver is doing stuff like
> > outb(vgaCRIndex, 0x43);
> > However I can't find the meaning of what's to be found at that  indirect 
> > register 0x43 at
> > 
> > Is this register typical for the s3?
> Yes.
One mistery solved. 

> > Or is there a better vga reference on the net where I can find the meaning
> > for those registers? Are the s3 968 docs somewhere on the net? 
BINGO! More mysteries solved!
The 3026 doc was not hard to read. However to acces registers you have to 
manipulate RS0-RS$ pins. They're mentioned in that doc!
And more bit poking code makes sense to me now.

> > 4) IF and only IF I can get it working.
> It seems that you have _all_ information you could ever wish for. All it takes
> is getting your head around all of this and pushing on.
Step by step: First step the probing :)

> > Should I sent patches to the list or make a bugzilla entry with 
> > attachments?
> Bugzilla, open a bug right away and assign it to yourself. I'll add myself
> asap, so that i can answer whatever questions you might have.

> > 
> > Greetz Mu
> > 
> > P.S: I had a lot of respect for people who made drivers for hardware with 
> > no docs and no source by reverse engineering.  Now that I'm trying to fix 
> > a driver for which most work is done, docs available and a working 
> > open source example (XFree3) is also available, my respect for them has 
> > grown to humongous proportions!
> You're doing a very noble thing. Hang in there, and ask all questions you
> have. Even if the answer make it straightforward afterwards, you can waste
> ages on "stupid" things with modesetting.
> Luc Verhaegen.
Well alll help helps :) And the pointer to the s3 doc  was for now the 
last peace of info I needed. So time for some coding now.

More information about the xorg mailing list