Skip to contentSkip to conversation

Fix VGA for MIPS Malta (big endian)

PATCH In review Stefan Weil 3 participants 3 messages Jul 20, 2008 – Oct 18, 2008 1 message not in the archive

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Fix VGA for MIPS Malta (big endian)

Hello,

this patch fixes the VGA display for MIPS Malta (big endian, 32 bit).

I have no tests for other big endian targets (32 or 64 bit). Do they have a working VGA display (then my patch must be restricted to MIPS and/or 32 bit), or do they show wrong pixel columns with current Qemu trunk, too?

Regards
Stefan

vga_template.h +11 -0
Index: hw/vga_template.h
===================================================================
@@ -327,6 +327,16 @@
     palette = s1->last_palette;
     width >>= 3;
     for(x = 0; x < width; x++) {
+#if defined(TARGET_WORDS_BIGENDIAN)
+        ((PIXEL_TYPE *)d)[3] = palette[s[0]];
+        ((PIXEL_TYPE *)d)[2] = palette[s[1]];
+        ((PIXEL_TYPE *)d)[1] = palette[s[2]];
+        ((PIXEL_TYPE *)d)[0] = palette[s[3]];
+        ((PIXEL_TYPE *)d)[7] = palette[s[4]];
+        ((PIXEL_TYPE *)d)[6] = palette[s[5]];
+        ((PIXEL_TYPE *)d)[5] = palette[s[6]];
+        ((PIXEL_TYPE *)d)[4] = palette[s[7]];
+#else
         ((PIXEL_TYPE *)d)[0] = palette[s[0]];
         ((PIXEL_TYPE *)d)[1] = palette[s[1]];
         ((PIXEL_TYPE *)d)[2] = palette[s[2]];
@@ -335,6 +345,7 @@
         ((PIXEL_TYPE *)d)[5] = palette[s[5]];
         ((PIXEL_TYPE *)d)[6] = palette[s[6]];
         ((PIXEL_TYPE *)d)[7] = palette[s[7]];
+#endif
         d += BPP * 8;
         s += 8;
     }
#1 lore raw
Quoted 8 lines · Stefan Weil

Hello,

this patch fixes the VGA display for MIPS Malta (big endian, 32 bit).

I have no tests for other big endian targets (32 or 64 bit). Do they have a working VGA display (then my patch must be restricted to MIPS and/or 32 bit), or do they show wrong pixel columns with current Qemu trunk, too?

Sparc64 uses VGA and the display is OK, but only in text mode so far. And there is a lot of byte swapping going on (or should be going on) so I wouldn't use that as a reference.

A message that is not in the archive (sent off-list or not yet received): [email protected]

#3 lore raw
Quoted 11 lines

---------- Forwarded message ----------
From: Stefan Weil <[email protected]>
Date: 2008/7/20
Subject: [Qemu-devel] [PATCH] Fix VGA for MIPS Malta (big endian)
To: QEMU Developers <[email protected]>

Hello,

this patch fixes the VGA display for MIPS Malta (big endian, 32 bit).

Quoted 8 lines

I have no tests for other big endian targets (32 or 64 bit). Do they have a working VGA display (then my patch must be restricted to MIPS and/or 32 bit), or do they show wrong pixel columns with current Qemu trunk, too?

Regards
Stefan

Hello,

I have a project requiring the VGA support in qemu-system-mips (MIPS, 32-bit, BE), and the suggested solution works for me. Without the proposed patch the picture in Qemu's SDL window is distorted and VGA support in Qemu is unusable, at least, for the MIPS 32-bit BE architecture. Hope this patch is going to be restricted to MIPS and 32-bit and committed to the repository. Thanks.

Anton