[PATCH] fb: fix fast-path detection

Keith Packard keithp at keithp.com
Mon Mar 24 12:10:56 PDT 2014


Daniel Kurtz <djkurtz at chromium.org> writes:

> +      int srcX,            /* bits */
> +      FbBits * dstLine,    /* pixels */
> +      FbStride dstStride,  /* pixels */

FbStride is in FbBits units, not pixels (yes, at 32bpp, it's the same)

> +      int dstX,            /* bits */
> +      int width,           /* bits */
>        int height, int alu, FbBits pm, int bpp, Bool reverse, Bool upsidedown)


> -    careful = !((srcLine < dstLine && srcLine + width * (bpp >> 3) > dstLine) ||
> -                (dstLine < srcLine && dstLine + width * (bpp >> 3) > srcLine))
> +    /* We must be careful if src and dst regions overlap */
> +    careful = ((srcLine < dstLine && srcLine + (width / bpp) > dstLine) ||
> +                (dstLine < srcLine && dstLine + (width / bpp) > srcLine))

I don't think that's correct either (although closer). srcLine + (width >>
FB_SHIFT) is what you want as that converts width from bits to FbBits units.

-- 
keith.packard at intel.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 810 bytes
Desc: not available
URL: <http://lists.x.org/archives/xorg-devel/attachments/20140324/fb04f0f6/attachment.sig>


More information about the xorg-devel mailing list