aboutsummaryrefslogtreecommitdiffstats
path: root/hw
diff options
context:
space:
mode:
authorAndrew Hsieh <andrewhsieh@google.com>2012-04-19 18:56:30 -0700
committerandroid code review <noreply-gerritcodereview@google.com>2012-04-19 18:56:31 -0700
commitb7d13b6fae601be9b19dbd24a46f2a06491a6a26 (patch)
treece077a1f21a03f06ac80f175d48a9fa53dfb1200 /hw
parentc135d75d5ae774d7349f1cf346eee03072047179 (diff)
parent832b23a22ac81ccd339b468402ee69750e351ad2 (diff)
downloadexternal_qemu-b7d13b6fae601be9b19dbd24a46f2a06491a6a26.zip
external_qemu-b7d13b6fae601be9b19dbd24a46f2a06491a6a26.tar.gz
external_qemu-b7d13b6fae601be9b19dbd24a46f2a06491a6a26.tar.bz2
Merge "[ENDIAN] Fix goldfish fb for bigendian targets"
Diffstat (limited to 'hw')
-rw-r--r--hw/goldfish_fb.c21
1 files changed, 15 insertions, 6 deletions
diff --git a/hw/goldfish_fb.c b/hw/goldfish_fb.c
index d74d797..16450b3 100644
--- a/hw/goldfish_fb.c
+++ b/hw/goldfish_fb.c
@@ -319,7 +319,11 @@ compute_fb_update_rect_linear(FbUpdateState* fbs,
xx1 = 0;
DUFF4(width, {
- if (src[xx1] != dst[xx1])
+ uint16_t spix = src[xx1];
+#if defined(HOST_WORDS_BIGENDIAN) != defined(TARGET_WORDS_BIGENDIAN)
+ spix = (uint16_t)((spix << 8) | (spix >> 8));
+#endif
+ if (spix != dst[xx1])
break;
xx1++;
});
@@ -332,8 +336,8 @@ compute_fb_update_rect_linear(FbUpdateState* fbs,
break;
xx2--;
});
-#if HOST_WORDS_BIGENDIAN
- /* Convert the guest little-endian pixels into big-endian ones */
+#if defined(HOST_WORDS_BIGENDIAN) != defined(TARGET_WORDS_BIGENDIAN)
+ /* Convert the guest pixels into host ones */
int xx = xx1;
DUFF4(xx2-xx1+1,{
unsigned spix = src[xx];
@@ -382,7 +386,12 @@ compute_fb_update_rect_linear(FbUpdateState* fbs,
xx1 = 0;
DUFF4(width, {
- if (src[xx1] != dst[xx1]) {
+ uint32_t spix = src[xx1];
+#if defined(HOST_WORDS_BIGENDIAN) != defined(TARGET_WORDS_BIGENDIAN)
+ spix = (spix << 16) | (spix >> 16);
+ spix = ((spix << 8) & 0xff00ff00) | ((spix >> 8) & 0x00ff00ff);
+#endif
+ if (spix != dst[xx1]) {
break;
}
xx1++;
@@ -397,8 +406,8 @@ compute_fb_update_rect_linear(FbUpdateState* fbs,
}
xx2--;
});
-#if HOST_WORDS_BIGENDIAN
- /* Convert the guest little-endian pixels into big-endian ones */
+#if defined(HOST_WORDS_BIGENDIAN) != defined(TARGET_WORDS_BIGENDIAN)
+ /* Convert the guest pixels into host ones */
int xx = xx1;
DUFF4(xx2-xx1+1,{
uint32_t spix = src[xx];