On Mon, Jan 05, 2004 at 07:50:18PM -0800, Eric Wittry wrote: >I have spent some time in vmodes.c, and now think that I mostly understand >how to derive the HDisplay, HTotal, VDisplay, and VTotal values from the >code. However, there is one element of the code that is really throwing >me for a loop.
>While I missed all of this the first time around, it seems pretty >reasonable, save for Step #2. Anything the driver does to a give argument >before sending it to the hardware, the hardware is likely going to have to >reverse to use the value, even if only conceptually. In the case of the >driver dividing by 8, the hardware will have to multiply by 8. However, >it is trivial, from a hardware perspective, to hardwire the video chip to >multiply a given argument by 8. > >On the other hand, it is far less trivial to hardwire the video chip to >add 1 to an argument, which the hardware would have to do to reverse what >we currently do at Step #2. This is not to say that it is impossible that >the hardware adds 1 to the values we pass, just that it strikes me as >extremely unlikely. Am I wrong to be skeptical? Yes. Don't try to apply too much analysis to how hardware registers are programmed. In the old days it was probably a tradeoff between making best use of the available register space and how the register values were applied. For modern hardware, these things are dwarfed by the complexity of other components of the video chips. Nevertheless, subtracting 1 makes sense if you consider the counting starts at 0, not 1, so counting from 0 to N - 1 results in N clock periods. Division by 8 for horizontal timings is because the programmed values traditionally represent 8-pixel wide characters. You might feel better if you look at vgahw/vgaHW.c, specifically the vgaHWInit() function, which handles the register setup for generic VGA-compatible hardware. On the other hand you may find more oddities there than you'd expect, including some other subtractions that I'm not going to attempt to explain, and some values scattered over multiple registers. The timing registers for the rendition chips look sane by comparison :-) I don't know if the register specs for the rendition chips are available anywhere, but you'd probably find them useful and informative. For general VGA-compatible registers, the specs for almost any VGA-compatible video chipset will include a section that covers them. David -- David Dawes developer/release engineer The XFree86 Project www.XFree86.org/~dawes _______________________________________________ Devel mailing list [EMAIL PROTECTED] http://XFree86.Org/mailman/listinfo/devel