Re: S3 driver bug

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Kevin Brosius wrote:
Thomas Winischhofer wrote:


Kevin Brosius wrote:


I know the s3virge series doesn't have a breshenham compliant engine,
and doubt the s3 variety does either.  Their may be logic in the s3
driver to try and simulate bresenham lines with the s3 engine though.

That wouldn't make sense as XAA supports both Bresenham and "normal" lines.


Thomas


Well, that kind of thing was attempted prior to XAA, but not in this
case, it appears.

I recall trouble with Bresenham on S3 hardware.  Maybe this is it.  It
certainly looks like the accel function is sending bresenham parameters
to the S3.

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.

Thomas

--
Thomas Winischhofer
Vienna/Austria
thomas AT winischhofer DOT net          *** http://www.winischhofer.net/
twini AT xfree86 DOT org



_______________________________________________
XFree86 mailing list
XFree86@xxxxxxxxxxx
http://XFree86.Org/mailman/listinfo/xfree86

[Index of Archives]     [X Forum]     [Xorg]     [XFree86 Newbie]     [IETF Announce]     [Security]     [Font Config]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux Kernel]

  Powered by Linux