1. The SPEA specific cards using the 801/5 chip apparently have an ID that's not 0xa0, rather, they either use 0xa2 or greater for the stepping. Fixes wrong colors in 800x600 modes and greater in 8bpp mode.
2. HWCursor addresses for 8bpp are now properly implemented if the 8bpp mode bit (CRTC3a bit 4) is checked, no longer relaying on GDCREG5 bit 6). Fixes garbage cursor in the SPEA 80x cards drivers (BigWin) using 8bpp mode.
1. __builtin_bswap{32,64} were added in GCC 4.3, and __builtin_bswap16
was added in GCC 4.8, however, currently, the GCC requirements in
bswap.h file has >= 10. This requirement of GCC version is false for
bswap* but true for __has_builtin() (as it first was added in GCC 10.1).
As bswap* builtins were added before GCC 10, the preprocessor check will
always going to be true for bswap but will be false if GCC version is
< 10 as __has_builtin() won't be present. Since the byteswap function,
on x86-64, can boil down to a single bswap instruction, this optimization
may left behind (unless GCC do some pattern matching). To avoid this,
just use the compiler macros (for GCC: __GNUC__, clang: __GNUC__ or
__clang__) and if the compiler is neither GCC or Clang, fall-back to
native implementation.
2. Remove the useless casts (uint{16,32,64}_t) from the constants. These
constants already has their own suffix, and casting to a different type
will just get ignored as the return value already gets casts to it's
appropriate type.
3. Previously, Clang couldn't able to use __builtin_bswap* (even if it was
newer) as LLVM define __GNUC__ macro to a specific constant (usually lower
than GCC's (__GNUC__) and on my system it's 4) which is indeed < 10. The
first comment also fixes this issue.
Link: <https://gcc.gnu.org/onlinedocs/gcc-4.3.0/gcc/Other-Builtins.html>
Link: <https://gcc.gnu.org/onlinedocs/gcc-4.8.0/gcc/Other-Builtins.html>
Link: <https://libc-alpha.sourceware.narkive.com/PfaB4BGP/patch-byteswap-h-fix-gcc-ver-test-for-builtin-bswap32>
plat_serpt_write_vcon(): write() returns how much data it has written
to the file descriptor, and in case an error, it returns -1. So the
EWOULDBLOCK never really triggers, as in the following condition we're
not checking the errno, but the return value of the write() function.
IBM/ATI 8514/A side:
Made mode switches more immediate when actually switching from VGA to 8514/A and viceversa.
Tseng ET4000AX/W32 series side:
Actually use bit 2 of index 0x3f for the horizontal blank start bit 8 instead of bit 4 (horizontal retrace start), fixes skew issues with the et4000w32i rev B. card with resolutions like 1024x768 at 15 or 16bpp and others.