Rawit wrote:Does that normally work? I have an S3 Savage4 with DFP(DVI) output. Perfect card, only problem with it is that its 640x400@70Hz output is recognized as 640x480@60Hz, on both VGA and DFP.
Good question. At least on VGA output it should work normally, but I bet there is an external DVI encoder chip and there is a possibility they are able to set sync polarity differently.
But if a monitor says it's 640x480@60Hz, it most likely is, as the measurements are usually based on signal timing instead of just sync polarity.
Rawit wrote:These resolutions mostly share the same variables, except that for 640x400 the hsync is negative instead of positive.
Not really, they have different amount of active lines and total lines per frame to make the frame rate difference, not just different sync polarity.
640x480 : (25175000 Hz pixel clock / 800 pixels per line) / 525 lines per frame = 59.94 Hz format (using 25.2MHz you get exactly 60.00 Hz).
640x400 : (25175000 Hz pixel clock / 800 pixels per line) / 449 lines per frame = 70.09 Hz format (using 25.2MHz you get 70.16 Hz).
(However, you might confuse this with 640x350 as it has exactly identical timing with 640x400 except the polarities are different).
In digital signals the sync polarities are not really useful but may need to be correct for it to work.
In analog VGA signals the sync polarities choose the CRT vertical scanning speed, which originally was limited to three modes, 350, 400 or 480 lines visible.
Rawit wrote:Reading from the register it shows that both hsync and vsync are set to positive.
That's quite odd; officially there is no such VGA mode. Did you read it from port 0x3CC?
640x480 has negative HS, negative VS.
640x400 has negative HS, positive VS.
640x350 has positive HS, negative VS.
Higher resolutions used both positive.