mirror of
https://github.com/X11Libre/xf86-video-mga.git
synced 2026-03-24 01:24:13 +00:00
a939aa56b3af4418d0c026a3775fde7288b0cca7
The memcpy specification doesn't specify how the destination is written - and on glibc 2.19 memcpy is doing some bytewise writes with the rep stosb instruction. These bytewise writes confuse the hardware (because it expects 32-bit writes) and result in image corruption. This patch replaces memcpy with explicit writes, so that the sequential write order and 32-bit write size is guaranteed. We use the "volatile" attribute to make sure that compiler optimizations won't cause write reordering. When reading the memory, we use a structure with "packed" attribute to avoid unaligned traps on RISC machines. Tested-by: Kevin Brace <kevinbrace@gmx.com> Signed-off-by: Mikulas Patocka <mikulas@twibright.com>
xf86-video-mga - Matrox video driver for the Xorg X server
All questions regarding this software should be directed at the Xorg mailing list:
https://lists.x.org/mailman/listinfo/xorg
The master development code repository can be found at:
https://gitlab.freedesktop.org/xorg/driver/xf86-video-mga
Please submit bug reports and requests to merge patches there.
For patch submission instructions, see:
https://www.x.org/wiki/Development/Documentation/SubmittingPatches
Description
Languages
C
98.6%
M4
0.8%
Makefile
0.6%