diff options
author | Richard Purdie <richard@openedhand.com> | 2006-05-25 08:03:03 +0000 |
---|---|---|
committer | Richard Purdie <richard@openedhand.com> | 2006-05-25 08:03:03 +0000 |
commit | f326127cf7bc6438bf367089e648a4359c9d39b5 (patch) | |
tree | ace7fc3a9e14cb60776313d582f091e6db4d97f9 /openembedded | |
parent | 7defc582e098a099f9056aa4ff18e200361ad512 (diff) | |
download | poky-f326127cf7bc6438bf367089e648a4359c9d39b5.tar.gz |
qemu: Add patches to add RGB support and fix some mouse problems
git-svn-id: https://svn.o-hand.com/repos/poky/trunk@416 311d38ba-8fff-0310-9ca6-ca027cbcb966
Diffstat (limited to 'openembedded')
-rw-r--r-- | openembedded/packages/qemu/files/mouse_fix-r0.patch | 25 | ||||
-rw-r--r-- | openembedded/packages/qemu/files/pl110_rgb-r0.patch | 219 | ||||
-rw-r--r-- | openembedded/packages/qemu/qemu_cvs.bb | 5 |
3 files changed, 248 insertions, 1 deletions
diff --git a/openembedded/packages/qemu/files/mouse_fix-r0.patch b/openembedded/packages/qemu/files/mouse_fix-r0.patch new file mode 100644 index 0000000000..8cc19f0392 --- /dev/null +++ b/openembedded/packages/qemu/files/mouse_fix-r0.patch | |||
@@ -0,0 +1,25 @@ | |||
1 | If the cursor is hidden (SDL_ShowCursor(0)) and the input is grabbed | ||
2 | (SDL_WM_GrabInput(SDL_GRAB_ON)), then the mouse will give relative motion | ||
3 | events even when the cursor reaches the edge fo the screen. This is currently | ||
4 | only implemented on Windows and Linux/Unix-a-likes. | ||
5 | |||
6 | Index: qemu/sdl.c | ||
7 | =================================================================== | ||
8 | --- qemu.orig/sdl.c 2006-04-13 12:22:22.000000000 +0100 | ||
9 | +++ qemu/sdl.c 2006-05-25 00:28:25.000000000 +0100 | ||
10 | @@ -280,13 +280,13 @@ | ||
11 | |||
12 | static void sdl_hide_cursor(void) | ||
13 | { | ||
14 | - SDL_SetCursor(sdl_cursor_hidden); | ||
15 | + SDL_ShowCursor(0); | ||
16 | } | ||
17 | |||
18 | static void sdl_show_cursor(void) | ||
19 | { | ||
20 | if (!kbd_mouse_is_absolute()) { | ||
21 | - SDL_SetCursor(sdl_cursor_normal); | ||
22 | + SDL_ShowCursor(1); | ||
23 | } | ||
24 | } | ||
25 | |||
diff --git a/openembedded/packages/qemu/files/pl110_rgb-r0.patch b/openembedded/packages/qemu/files/pl110_rgb-r0.patch new file mode 100644 index 0000000000..09e5898d3a --- /dev/null +++ b/openembedded/packages/qemu/files/pl110_rgb-r0.patch | |||
@@ -0,0 +1,219 @@ | |||
1 | Index: qemu/hw/pl110.c | ||
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 | ||
5 | @@ -10,6 +10,7 @@ | ||
6 | #include "vl.h" | ||
7 | |||
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 | ||
13 | @@ -115,6 +116,7 @@ | ||
14 | int first, last = 0; | ||
15 | int dirty, new_dirty; | ||
16 | int i; | ||
17 | + int bpp_offset; | ||
18 | |||
19 | if (!pl110_enabled(s)) | ||
20 | return; | ||
21 | @@ -146,12 +148,17 @@ | ||
22 | fprintf(stderr, "pl110: Bad color depth\n"); | ||
23 | exit(1); | ||
24 | } | ||
25 | + if (s->cr & PL110_CR_BGR) | ||
26 | + bpp_offset = 0; | ||
27 | + else | ||
28 | + bpp_offset = 18; | ||
29 | + | ||
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]; | ||
36 | else | ||
37 | - fn = fntable[s->bpp]; | ||
38 | + fn = fntable[s->bpp + bpp_offset]; | ||
39 | |||
40 | src_width = s->cols; | ||
41 | switch (s->bpp) { | ||
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 | ||
46 | @@ -24,6 +24,16 @@ | ||
47 | #error unknown bit depth | ||
48 | #endif | ||
49 | |||
50 | +#undef RGB | ||
51 | +#define BORDER bgr | ||
52 | +#define ORDER 0 | ||
53 | +#include "pl110_template.h" | ||
54 | +#define ORDER 1 | ||
55 | +#include "pl110_template.h" | ||
56 | +#define ORDER 2 | ||
57 | +#include "pl110_template.h" | ||
58 | +#define RGB | ||
59 | +#define BORDER rgb | ||
60 | #define ORDER 0 | ||
61 | #include "pl110_template.h" | ||
62 | #define ORDER 1 | ||
63 | @@ -33,26 +43,47 @@ | ||
64 | |||
65 | static drawfn glue(pl110_draw_fn_,BITS)[18] = | ||
66 | { | ||
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), | ||
73 | - | ||
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), | ||
80 | - | ||
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), | ||
93 | + | ||
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), | ||
100 | + | ||
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), | ||
107 | + | ||
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), | ||
114 | + | ||
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), | ||
121 | + | ||
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), | ||
128 | }; | ||
129 | |||
130 | #undef BITS | ||
131 | @@ -61,18 +92,18 @@ | ||
132 | #else | ||
133 | |||
134 | #if ORDER == 0 | ||
135 | -#define NAME glue(lblp, BITS) | ||
136 | +#define NAME glue(glue(lblp_, BORDER), BITS) | ||
137 | #ifdef WORDS_BIGENDIAN | ||
138 | #define SWAP_WORDS 1 | ||
139 | #endif | ||
140 | #elif ORDER == 1 | ||
141 | -#define NAME glue(bbbp, BITS) | ||
142 | +#define NAME glue(glue(bbbp_, BORDER), BITS) | ||
143 | #ifndef WORDS_BIGENDIAN | ||
144 | #define SWAP_WORDS 1 | ||
145 | #endif | ||
146 | #else | ||
147 | #define SWAP_PIXELS 1 | ||
148 | -#define NAME glue(lbbp, BITS) | ||
149 | +#define NAME glue(glue(lbbp_, BORDER), BITS) | ||
150 | #ifdef WORDS_BIGENDIAN | ||
151 | #define SWAP_WORDS 1 | ||
152 | #endif | ||
153 | @@ -195,27 +226,34 @@ | ||
154 | #ifdef SWAP_WORDS | ||
155 | data = bswap32(data); | ||
156 | #endif | ||
157 | +#ifdef RGB | ||
158 | +#define LSB r | ||
159 | +#define MSB b | ||
160 | +#else | ||
161 | +#define LSB b | ||
162 | +#define MSB r | ||
163 | +#endif | ||
164 | #if 0 | ||
165 | - r = data & 0x1f; | ||
166 | + LSB = data & 0x1f; | ||
167 | data >>= 5; | ||
168 | g = data & 0x3f; | ||
169 | data >>= 6; | ||
170 | - b = data & 0x1f; | ||
171 | + MSB = data & 0x1f; | ||
172 | data >>= 5; | ||
173 | #else | ||
174 | - r = (data & 0x1f) << 3; | ||
175 | + LSB = (data & 0x1f) << 3; | ||
176 | data >>= 5; | ||
177 | g = (data & 0x3f) << 2; | ||
178 | data >>= 6; | ||
179 | - b = (data & 0x1f) << 3; | ||
180 | + MSB = (data & 0x1f) << 3; | ||
181 | data >>= 5; | ||
182 | #endif | ||
183 | COPY_PIXEL(d, glue(rgb_to_pixel,BITS)(r, g, b)); | ||
184 | - r = (data & 0x1f) << 3; | ||
185 | + LSB = (data & 0x1f) << 3; | ||
186 | data >>= 5; | ||
187 | g = (data & 0x3f) << 2; | ||
188 | data >>= 6; | ||
189 | - b = (data & 0x1f) << 3; | ||
190 | + MSB = (data & 0x1f) << 3; | ||
191 | data >>= 5; | ||
192 | COPY_PIXEL(d, glue(rgb_to_pixel,BITS)(r, g, b)); | ||
193 | width -= 2; | ||
194 | @@ -229,14 +267,21 @@ | ||
195 | unsigned int r, g, b; | ||
196 | while (width > 0) { | ||
197 | data = *(uint32_t *)src; | ||
198 | +#ifdef RGB | ||
199 | +#define LSB r | ||
200 | +#define MSB b | ||
201 | +#else | ||
202 | +#define LSB b | ||
203 | +#define MSB r | ||
204 | +#endif | ||
205 | #ifdef SWAP_WORDS | ||
206 | - r = data & 0xff; | ||
207 | + LSB = data & 0xff; | ||
208 | g = (data >> 8) & 0xff; | ||
209 | - b = (data >> 16) & 0xff; | ||
210 | + MSB = (data >> 16) & 0xff; | ||
211 | #else | ||
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; | ||
217 | #endif | ||
218 | COPY_PIXEL(d, glue(rgb_to_pixel,BITS)(r, g, b)); | ||
219 | width--; | ||
diff --git a/openembedded/packages/qemu/qemu_cvs.bb b/openembedded/packages/qemu/qemu_cvs.bb index 5ebc18c6a4..bf0c76152c 100644 --- a/openembedded/packages/qemu/qemu_cvs.bb +++ b/openembedded/packages/qemu/qemu_cvs.bb | |||
@@ -1,9 +1,12 @@ | |||
1 | LICENSE = "GPL" | 1 | LICENSE = "GPL" |
2 | PV = "0.8.0+cvs${SRCDATE}" | 2 | PV = "0.8.0+cvs${SRCDATE}" |
3 | PR = "r1" | ||
3 | 4 | ||
4 | SRC_URI = "cvs://anonymous@cvs.savannah.nongnu.org/sources/qemu;method=pserver;rsh=ssh;module=qemu \ | 5 | SRC_URI = "cvs://anonymous@cvs.savannah.nongnu.org/sources/qemu;method=pserver;rsh=ssh;module=qemu \ |
5 | file://nodocs_cvs.patch;patch=1 \ | 6 | file://nodocs_cvs.patch;patch=1 \ |
6 | file://configure.patch;patch=1" | 7 | file://configure.patch;patch=1 \ |
8 | file://mouse_fix-r0.patch;patch=1 \ | ||
9 | file://pl110_rgb-r0.patch;patch=1" | ||
7 | 10 | ||
8 | S = "${WORKDIR}/qemu" | 11 | S = "${WORKDIR}/qemu" |
9 | 12 | ||