Hey all,
So for my OS I've decided that I'm not really concerned with supporting every piece of hardware under the sun, and since ATI have so nicely released the first parts of the register reference (and I use both their m56 and rv630 based video cards already) I thought I would focus on support those two chipsets exclusively.
The register reference is a fantastic piece of info, but on it's own it doesn't really specify enough detail on how to initalize the card, enumerate or set modes etc. So either there needs to be a programming guide to accompany the register guide (I don't think they have released such a document) or perhaps some sample source code for those chips.
Does anyone know where I might be able to get source-code or tutorial specifically for the rv630/m56 ati chipsets?
Thanks
John
Video Driver Code
- Combuster
- Member
- Posts: 9301
- Joined: Wed Oct 18, 2006 3:45 am
- Libera.chat IRC: [com]buster
- Location: On the balcony, where I can actually keep 1½m distance
- Contact:
Being that those cards are comparatively new, the chance of finding decent sourcecode is relatively small. The first and foremost place to look for drivers is in the sourcecode of X.org.
Since register-level programming of video cards hasn't been necessary since DOS moved to the home for elderly oses, your efforts to find one for the latest ati cards is doomed from the start. Even finding one for the good 'ole VGA is hard enough.
I haven't read the aforementioned documents myself, but usually setting up a video mode has similar steps across many video cards:
1: compute horizontal total, blank start/end, hsync start/end
2: compute vertical total, blank start/end, vsync start/end
3: decide on the appropriate clock source needed to get the desired refresh rate
After that, you can program the card:
4: disable video output
5: pick the correct clock source
6: set the memory offset, bit depth, virtual width, and other sequencer-related registers to have the video card render everything correctly.
7: set the horizontal and vertical resolution registers to fit the resolution
8: write all the CRTC-related registers (those computed in 1+2)
9: choose the correct H/V polarity settings
10: set up the palettes, gamma ramps etc to correct values.
11: clear the screen
12: re-enable video output
The VGA Hardware page holds a lot of information on this sequence for the VGA card, which you can use for comparison. Most likely you'll be able to find many similarities when comparing the information to the ATI specs.
The video cards I have worked with generally support all resolutions that are a multiple of 8 in size. They only list the ones one would find useful (i.e. 640x480, 800x600, 1024x768, ...). Given the clock frequency, you can compute the maximum theoretical resolution by solving a height and width for a refresh rate of 60Hz - if the register sizes are large enough. Be aware that monitors are likely limited to a range of horizontal refresh rates and vertical refresh rates. Old monitors might even stop working (for good, i.e. BIG WARNING SIGN) when given the wrong signal.
Other tricks you might want to try include using VESA to set the desired mode then reading out the card's registers and comparing them to the specifications.
For starters, you might want to practice vga-based mode changes and play around a bit with them to get some feeling for how things work before you start decoding the ati specifications.
I still hope they'll release the Mach64/3D rage specs (that's the chip most of my computers have)
Since register-level programming of video cards hasn't been necessary since DOS moved to the home for elderly oses, your efforts to find one for the latest ati cards is doomed from the start. Even finding one for the good 'ole VGA is hard enough.
I haven't read the aforementioned documents myself, but usually setting up a video mode has similar steps across many video cards:
1: compute horizontal total, blank start/end, hsync start/end
2: compute vertical total, blank start/end, vsync start/end
3: decide on the appropriate clock source needed to get the desired refresh rate
After that, you can program the card:
4: disable video output
5: pick the correct clock source
6: set the memory offset, bit depth, virtual width, and other sequencer-related registers to have the video card render everything correctly.
7: set the horizontal and vertical resolution registers to fit the resolution
8: write all the CRTC-related registers (those computed in 1+2)
9: choose the correct H/V polarity settings
10: set up the palettes, gamma ramps etc to correct values.
11: clear the screen
12: re-enable video output
The VGA Hardware page holds a lot of information on this sequence for the VGA card, which you can use for comparison. Most likely you'll be able to find many similarities when comparing the information to the ATI specs.
The video cards I have worked with generally support all resolutions that are a multiple of 8 in size. They only list the ones one would find useful (i.e. 640x480, 800x600, 1024x768, ...). Given the clock frequency, you can compute the maximum theoretical resolution by solving a height and width for a refresh rate of 60Hz - if the register sizes are large enough. Be aware that monitors are likely limited to a range of horizontal refresh rates and vertical refresh rates. Old monitors might even stop working (for good, i.e. BIG WARNING SIGN) when given the wrong signal.
Other tricks you might want to try include using VESA to set the desired mode then reading out the card's registers and comparing them to the specifications.
For starters, you might want to practice vga-based mode changes and play around a bit with them to get some feeling for how things work before you start decoding the ati specifications.
I still hope they'll release the Mach64/3D rage specs (that's the chip most of my computers have)
Thanks for the suggestions and info!
I will definately be writing a VGA driver first, as this is the easiest to work with and test. Plus I remember vaguely how it all works from my dos/pmode days setting modex modes without bios.
The idea with the OS i'm working on is basically to create a system for a fixed architecture machine, so it won't necessarily be used on any pc or component, and I will then use it for special projects etc.
So as long as I have one really decent video card supported that is fine, and a sound card obviously
I will definately be writing a VGA driver first, as this is the easiest to work with and test. Plus I remember vaguely how it all works from my dos/pmode days setting modex modes without bios.
The idea with the OS i'm working on is basically to create a system for a fixed architecture machine, so it won't necessarily be used on any pc or component, and I will then use it for special projects etc.
So as long as I have one really decent video card supported that is fine, and a sound card obviously