mesa: fix swapped colors
When the screen's framebuffer and CPU have different endianness, the colors are displayed swapped (e.g. BGRA becomes ARGB when a big-endian CPU writes to little-endian framebuffer). To fix this, Mesa needs to detect the framebuffer format and swap the color format when the framebuffer and CPU endianness don't match. In order to detect the framebuffer format, this change adds a new function to SWRast loader extension, that obtains the RGB offsets from X. For now, only swapped BGRA/BGRX formats are supported.