xserver-multidpi/fb
Adam Jackson e32cc0b4c8 fb: Fix memcpy abuse
The memcpy fast path implicitly assumes that the copy walks
left-to-right.  That's not something memcpy guarantees, and newer glibc
on some processors will indeed break that assumption.  Since we walk a
line at a time, check the source and destination against the width of
the blit to determine whether we can be sloppy enough to allow memcpy.
(Having done this, we can remove the check for !reverse as well.)

On an Intel Core i7-2630QM with an NVIDIA GeForce GTX 460M running in
NoAccel, the broken code and various fixes for -copywinwin{10,100,500}
gives (edited to fit in 80 columns):

1: Disable the fastpath entirely
2: Replace memcpy with memmove
3: This fix
4: The code before this fix

  1            2                 3                 4           Operation
------   ---------------   ---------------   ---------------   ------------
258000   269000 (  1.04)   544000 (  2.11)   552000 (  2.14)   Copy 10x10
 21300    23000 (  1.08)    43700 (  2.05)    47100 (  2.21)   Copy 100x100
   960      962 (  1.00)     1990 (  2.09)     1990 (  2.07)   Copy 500x500

So it's a modest performance hit, but correctness demands it, and it's
probably worth keeping the 2x speedup from having the fast path in the
first place.

Signed-off-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2011-08-15 15:38:16 -07:00
..
fb.h fb: drop comments around 24-bit support. 2011-04-01 10:32:27 +10:00
fb24_32.c fb: Mark some variables as unused. 2011-06-16 00:43:50 +02:00
fb24_32.h Death to RCS tags. 2007-06-29 14:06:52 -04:00
fballpriv.c fb: drop defines that aren't used/necessary anymore. 2011-04-01 10:28:06 +10:00
fbarc.c fb: Simplify logic, get rid of set but unused variable. 2011-06-16 00:43:49 +02:00
fbbits.c fb: drop defines that aren't used/necessary anymore. 2011-04-01 10:28:06 +10:00
fbbits.h fb: make isClipped always reject negative coordinates (bug 11503) 2010-08-20 10:01:48 -07:00
fbblt.c fb: Fix memcpy abuse 2011-08-15 15:38:16 -07:00
fbbltone.c fbbltone.c: Mark bitmasks as unsigned ints 2011-05-25 09:35:39 -06:00
fbcmap_mi.c Sun's copyrights now belong to Oracle 2010-12-07 11:10:35 -08:00
fbcopy.c fb: drop defines that aren't used/necessary anymore. 2011-04-01 10:28:06 +10:00
fbfill.c fb: Mark some variables as unused. 2011-06-16 00:43:50 +02:00
fbfillrect.c Rename region macros to eliminate screen argument 2010-06-05 18:59:00 -07:00
fbfillsp.c Rename region macros to eliminate screen argument 2010-06-05 18:59:00 -07:00
fbgc.c fb: Mark some variables as unused. 2011-06-16 00:43:50 +02:00
fbgetsp.c fb: drop defines that aren't used/necessary anymore. 2011-04-01 10:28:06 +10:00
fbglyph.c fb: drop defines that aren't used/necessary anymore. 2011-04-01 10:28:06 +10:00
fbimage.c fb: drop defines that aren't used/necessary anymore. 2011-04-01 10:28:06 +10:00
fbline.c fb: drop defines that aren't used/necessary anymore. 2011-04-01 10:28:06 +10:00
fboverlay.c fb: fix memory leak in fbOverlayFinishScreenInit 2011-04-04 15:41:13 +03:00
fboverlay.h fb: move some code to mi 2009-02-06 18:42:39 +01:00
fbpict.c fb: Silence warnings when building with clang 2011-04-25 10:45:34 -07:00
fbpict.h Move miTriangles to fb as fbTriangles() 2011-02-26 13:58:54 -05:00
fbpixmap.c fb: drop defines that aren't used/necessary anymore. 2011-04-01 10:28:06 +10:00
fbpoint.c fb: drop defines that aren't used/necessary anymore. 2011-04-01 10:28:06 +10:00
fbpush.c fb: Mark some variables as unused. 2011-06-16 00:43:50 +02:00
fbrop.h Rework symbol visibility for easier maintenance 2008-12-03 05:43:34 -02:00
fbscreen.c mi: fix memory leak in miInitVisuals 2011-04-04 15:41:13 +03:00
fbseg.c fb: drop defines that aren't used/necessary anymore. 2011-04-01 10:28:06 +10:00
fbsetsp.c fb: drop defines that aren't used/necessary anymore. 2011-04-01 10:28:06 +10:00
fbsolid.c fb: drop defines that aren't used/necessary anymore. 2011-04-01 10:28:06 +10:00
fbstipple.c fb: drop defines that aren't used/necessary anymore. 2011-04-01 10:28:06 +10:00
fbtile.c Rework symbol visibility for easier maintenance 2008-12-03 05:43:34 -02:00
fbtrap.c Fix trapezoid and triangle rendering to windows 2011-04-22 22:11:20 -04:00
fbutil.c Rework symbol visibility for easier maintenance 2008-12-03 05:43:34 -02:00
fbwindow.c fb: cleanup fbChangeWindowAttributes 2011-04-01 11:02:17 +10:00
Makefile.am fb: Remove hw/xfree86/ from includes 2011-02-08 12:41:13 -05:00
wfbrename.h fb: Delete a bunch more left-overs 2010-11-02 03:36:45 -04:00