fb_generic: fix blit2FB for big endian processors

Origin commit data
------------------
Commit: 87b7985892
Author: Stefan Seyfried <seife@tuxbox-git.slipkontur.de>
Date: 2018-02-25 (Sun, 25 Feb 2018)
This commit is contained in:
Stefan Seyfried
2018-02-25 21:36:44 +01:00
committed by vanhofen
parent a44d039372
commit 41b0802d6a

View File

@@ -41,6 +41,7 @@
#include <sys/mman.h>
#include <memory.h>
#include <math.h>
#include <endian.h>
#include <linux/kd.h>
@@ -1704,7 +1705,14 @@ void CFrameBuffer::blit2FB(void *fbbuff, uint32_t width, uint32_t height, uint32
else {
uint8_t *in = (uint8_t *)(pixpos + xp);
uint8_t *out = (uint8_t *)d2;
#if __BYTE_ORDER == __LITTLE_ENDIAN
int a = in[3]; /* TODO: big/little endian */
#elif __BYTE_ORDER == __BIG_ENDIAN
int a = in[0];
out++; in++;
#else
#error neither big nor little endian???
#endif
*out = (*out + ((*in - *out) * a) / 256);
in++; out++;
*out = (*out + ((*in - *out) * a) / 256);