aboutsummaryrefslogtreecommitdiff
path: root/hw/display
diff options
context:
space:
mode:
authorMarcus Comstedt <marcus@mc.pp.se>2018-09-19 14:31:14 +0200
committerDavid Gibson <david@gibson.dropbear.id.au>2018-09-25 11:12:25 +1000
commitf3a60058c97f2f923e3883a8b129c7c8dfe46a3a (patch)
tree035e8c7da4cbc763fa73b58e14da633646320833 /hw/display
parent0976efd51bbfb28292704a248cb9454fc12f911d (diff)
downloadqemu-f3a60058c97f2f923e3883a8b129c7c8dfe46a3a.zip
qemu-f3a60058c97f2f923e3883a8b129c7c8dfe46a3a.tar.gz
qemu-f3a60058c97f2f923e3883a8b129c7c8dfe46a3a.tar.bz2
sm501: Adjust endianness of pixel value in rectangle fill
The value from twoD_foreground (which is in host endian format) must be converted to the endianness of the framebuffer (currently always little endian) before it can be used to perform the fill operation. Signed-off-by: Marcus Comstedt <marcus@mc.pp.se> Reviewed-by: BALATON Zoltan <balaton@eik.bme.hu> Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Diffstat (limited to 'hw/display')
-rw-r--r--hw/display/sm501.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/hw/display/sm501.c b/hw/display/sm501.c
index 874260a..4a8686f 100644
--- a/hw/display/sm501.c
+++ b/hw/display/sm501.c
@@ -39,6 +39,7 @@
#include "hw/i2c/i2c-ddc.h"
#include "qemu/range.h"
#include "ui/pixel_ops.h"
+#include "qemu/bswap.h"
/*
* Status: 2010/05/07
@@ -812,9 +813,11 @@ static void sm501_2d_operation(SM501State *s)
FILL_RECT(1, uint8_t);
break;
case 1:
+ color = cpu_to_le16(color);
FILL_RECT(2, uint16_t);
break;
case 2:
+ color = cpu_to_le32(color);
FILL_RECT(4, uint32_t);
break;
}