2 ===================================================================
3 --- qemu.orig/hw/pl110.c 2006-04-11 21:49:46.000000000 +0100
4 +++ qemu/hw/pl110.c 2006-05-24 22:53:00.000000000 +0100
8 #define PL110_CR_EN 0x001
9 +#define PL110_CR_BGR 0x100
10 #define PL110_CR_BEBO 0x200
11 #define PL110_CR_BEPO 0x400
12 #define PL110_CR_PWR 0x800
19 if (!pl110_enabled(s))
22 fprintf(stderr, "pl110: Bad color depth\n");
25 + if (s->cr & PL110_CR_BGR)
30 if (s->cr & PL110_CR_BEBO)
31 - fn = fntable[s->bpp + 6];
32 + fn = fntable[s->bpp + 6 + bpp_offset];
33 else if (s->cr & PL110_CR_BEPO)
34 - fn = fntable[s->bpp + 12];
35 + fn = fntable[s->bpp + 12 + bpp_offset];
37 - fn = fntable[s->bpp];
38 + fn = fntable[s->bpp + bpp_offset];
42 Index: qemu/hw/pl110_template.h
43 ===================================================================
44 --- qemu.orig/hw/pl110_template.h 2006-02-19 12:31:32.000000000 +0000
45 +++ qemu/hw/pl110_template.h 2006-05-24 23:04:03.000000000 +0100
47 #error unknown bit depth
53 +#include "pl110_template.h"
55 +#include "pl110_template.h"
57 +#include "pl110_template.h"
61 #include "pl110_template.h"
65 static drawfn glue(pl110_draw_fn_,BITS)[18] =
67 - glue(pl110_draw_line1_lblp,BITS),
68 - glue(pl110_draw_line2_lblp,BITS),
69 - glue(pl110_draw_line4_lblp,BITS),
70 - glue(pl110_draw_line8_lblp,BITS),
71 - glue(pl110_draw_line16_lblp,BITS),
72 - glue(pl110_draw_line32_lblp,BITS),
74 - glue(pl110_draw_line1_bbbp,BITS),
75 - glue(pl110_draw_line2_bbbp,BITS),
76 - glue(pl110_draw_line4_bbbp,BITS),
77 - glue(pl110_draw_line8_bbbp,BITS),
78 - glue(pl110_draw_line16_bbbp,BITS),
79 - glue(pl110_draw_line32_bbbp,BITS),
81 - glue(pl110_draw_line1_lbbp,BITS),
82 - glue(pl110_draw_line2_lbbp,BITS),
83 - glue(pl110_draw_line4_lbbp,BITS),
84 - glue(pl110_draw_line8_lbbp,BITS),
85 - glue(pl110_draw_line16_lbbp,BITS),
86 - glue(pl110_draw_line32_lbbp,BITS)
87 + glue(pl110_draw_line1_lblp_bgr,BITS),
88 + glue(pl110_draw_line2_lblp_bgr,BITS),
89 + glue(pl110_draw_line4_lblp_bgr,BITS),
90 + glue(pl110_draw_line8_lblp_bgr,BITS),
91 + glue(pl110_draw_line16_lblp_bgr,BITS),
92 + glue(pl110_draw_line32_lblp_bgr,BITS),
94 + glue(pl110_draw_line1_bbbp_bgr,BITS),
95 + glue(pl110_draw_line2_bbbp_bgr,BITS),
96 + glue(pl110_draw_line4_bbbp_bgr,BITS),
97 + glue(pl110_draw_line8_bbbp_bgr,BITS),
98 + glue(pl110_draw_line16_bbbp_bgr,BITS),
99 + glue(pl110_draw_line32_bbbp_bgr,BITS),
101 + glue(pl110_draw_line1_lbbp_bgr,BITS),
102 + glue(pl110_draw_line2_lbbp_bgr,BITS),
103 + glue(pl110_draw_line4_lbbp_bgr,BITS),
104 + glue(pl110_draw_line8_lbbp_bgr,BITS),
105 + glue(pl110_draw_line16_lbbp_bgr,BITS),
106 + glue(pl110_draw_line32_lbbp_bgr,BITS),
108 + glue(pl110_draw_line1_lblp_rgb,BITS),
109 + glue(pl110_draw_line2_lblp_rgb,BITS),
110 + glue(pl110_draw_line4_lblp_rgb,BITS),
111 + glue(pl110_draw_line8_lblp_rgb,BITS),
112 + glue(pl110_draw_line16_lblp_rgb,BITS),
113 + glue(pl110_draw_line32_lblp_rgb,BITS),
115 + glue(pl110_draw_line1_bbbp_rgb,BITS),
116 + glue(pl110_draw_line2_bbbp_rgb,BITS),
117 + glue(pl110_draw_line4_bbbp_rgb,BITS),
118 + glue(pl110_draw_line8_bbbp_rgb,BITS),
119 + glue(pl110_draw_line16_bbbp_rgb,BITS),
120 + glue(pl110_draw_line32_bbbp_rgb,BITS),
122 + glue(pl110_draw_line1_lbbp_rgb,BITS),
123 + glue(pl110_draw_line2_lbbp_rgb,BITS),
124 + glue(pl110_draw_line4_lbbp_rgb,BITS),
125 + glue(pl110_draw_line8_lbbp_rgb,BITS),
126 + glue(pl110_draw_line16_lbbp_rgb,BITS),
127 + glue(pl110_draw_line32_lbbp_rgb,BITS),
135 -#define NAME glue(lblp, BITS)
136 +#define NAME glue(glue(lblp_, BORDER), BITS)
137 #ifdef WORDS_BIGENDIAN
141 -#define NAME glue(bbbp, BITS)
142 +#define NAME glue(glue(bbbp_, BORDER), BITS)
143 #ifndef WORDS_BIGENDIAN
147 #define SWAP_PIXELS 1
148 -#define NAME glue(lbbp, BITS)
149 +#define NAME glue(glue(lbbp_, BORDER), BITS)
150 #ifdef WORDS_BIGENDIAN
153 @@ -195,27 +226,34 @@
155 data = bswap32(data);
174 - r = (data & 0x1f) << 3;
175 + LSB = (data & 0x1f) << 3;
177 g = (data & 0x3f) << 2;
179 - b = (data & 0x1f) << 3;
180 + MSB = (data & 0x1f) << 3;
183 COPY_PIXEL(d, glue(rgb_to_pixel,BITS)(r, g, b));
184 - r = (data & 0x1f) << 3;
185 + LSB = (data & 0x1f) << 3;
187 g = (data & 0x3f) << 2;
189 - b = (data & 0x1f) << 3;
190 + MSB = (data & 0x1f) << 3;
192 COPY_PIXEL(d, glue(rgb_to_pixel,BITS)(r, g, b));
194 @@ -229,14 +267,21 @@
195 unsigned int r, g, b;
197 data = *(uint32_t *)src;
208 g = (data >> 8) & 0xff;
209 - b = (data >> 16) & 0xff;
210 + MSB = (data >> 16) & 0xff;
212 - r = (data >> 24) & 0xff;
213 + LSB = (data >> 24) & 0xff;
214 g = (data >> 16) & 0xff;
215 - b = (data >> 8) & 0xff;
216 + MSB = (data >> 8) & 0xff;
218 COPY_PIXEL(d, glue(rgb_to_pixel,BITS)(r, g, b));