Apparently, after looking into the 3.3.6 code, the first generations of S3 do support Bresenham lines after all.
What I see from comparing the code is that the 3.3.6 version does a lot of stuff to reduce the error term to 12 bit which is the hardware's maximum.
The 4.x code, although demanding a 12bit Bresenham error term from XAA, simply adds the given minor and error term and writes the result to the hardware register, without checking it for overflows. I don't know what values this function is given, but in case the values are somewhat big, this may result in a completely wrong error term. The result may very well look like what the original poster saw, namely lines with a wrong slope.
Furthermore, I think the way the error term, e1 and e2 values are calculated differ:
3.3:
(deltas: adx = x2 - x1; ady = y2 - y1)
if (adx > ady) { axis = X_AXIS; <-- x is major axis; adx=major > ady=minor e1 = ady << 1; e2 = e1 - (adx << 1); e = e1 - adx; } else { axis = Y_AXIS; <-- y is major axis; adx=minor < ady=major e1 = adx << 1; e2 = e1 - (ady << 1); e = e1 - ady; ... }
Simply put, if I understood that right, this does
e1 = minor; e2 = minor - major;
4.x:
Here it looks like this:
e1 = major; e2 = minor - major;
Would be interesting to know what impact this difference has. If anybody's interested, I could compile the driver with that change and send out the binary.
That would be great! Will the binary be a replacement for /usr/bin/X11/XFree86 or will I have to change something else to test it?
Klaus
_______________________________________________ XFree86 mailing list XFree86@xxxxxxxxxxx http://XFree86.Org/mailman/listinfo/xfree86