~ubuntu-branches/ubuntu/trusty/qemu/trusty

« back to all changes in this revision

Viewing changes to debian/patches/ubuntu/linaro/0044-add-hw-omap_dss_drawfn.h.patch

  • Committer: Package Import Robot
  • Author(s): Serge Hallyn
  • Date: 2014-02-04 12:13:08 UTC
  • mfrom: (10.1.45 sid)
  • Revision ID: package-import@ubuntu.com-20140204121308-1xq92lrfs75agw2g
Tags: 1.7.0+dfsg-3ubuntu1~ppa1
* Merge 1.7.0+dfsg-3 from debian.  Remaining changes:
  - debian/patches/ubuntu:
    * expose-vmx_qemu64cpu.patch
    * linaro (omap3) and arm64 patches
    * ubuntu/target-ppc-add-stubs-for-kvm-breakpoints: fix FTBFS
      on ppc
    * ubuntu/CVE-2013-4377.patch: fix denial of service via virtio
  - debian/qemu-system-x86.modprobe: set kvm_intel nested=1 options
  - debian/control:
    * add arm64 to Architectures
    * add qemu-common and qemu-system-aarch64 packages
  - debian/qemu-system-common.install: add debian/tmp/usr/lib
  - debian/qemu-system-common.preinst: add kvm group
  - debian/qemu-system-common.postinst: remove acl placed by udev,
    and add udevadm trigger.
  - qemu-system-x86.links: add eepro100.rom, remove pxe-virtio,
    pxe-e1000 and pxe-rtl8139.
  - add qemu-system-x86.qemu-kvm.upstart and .default
  - qemu-user-static.postinst-in: remove arm64 binfmt
  - debian/rules:
    * allow parallel build
    * add aarch64 to system_targets and sys_systems
    * add qemu-kvm-spice links
    * install qemu-system-x86.modprobe
  - add debian/qemu-system-common.links for OVMF.fd link
* Remove kvm-img, kvm-nbd, kvm-ifup and kvm-ifdown symlinks.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
From 908554036eb2c00523a0aa34563efa0df35ebca3 Mon Sep 17 00:00:00 2001
 
2
From: Riku Voipio <riku.voipio@nokia.com>
 
3
Date: Mon, 18 Feb 2013 16:58:31 +0000
 
4
Subject: [PATCH 44/70] add hw/omap_dss_drawfn.h
 
5
 
 
6
Omap DSS draw functions
 
7
---
 
8
 hw/display/omap_dss_drawfn.h | 284 +++++++++++++++++++++++++++++++++++++++++++
 
9
 1 file changed, 284 insertions(+)
 
10
 create mode 100644 hw/display/omap_dss_drawfn.h
 
11
 
 
12
diff --git a/hw/display/omap_dss_drawfn.h b/hw/display/omap_dss_drawfn.h
 
13
new file mode 100644
 
14
index 0000000..37ba136
 
15
--- /dev/null
 
16
+++ b/hw/display/omap_dss_drawfn.h
 
17
@@ -0,0 +1,284 @@
 
18
+/*
 
19
+ * QEMU OMAP DSS display plane rendering emulation templates
 
20
+ *
 
21
+ * Copyright (c) 2008 yajin  <yajin@vm-kernel.org>
 
22
+ * Copyright (c) 2008-2009 Nokia Corporation
 
23
+ *
 
24
+ * This program is free software; you can redistribute it and/or
 
25
+ * modify it under the terms of the GNU General Public License as
 
26
+ * published by the Free Software Foundation; either version 2 or
 
27
+ * (at your option) version 3 of the License.
 
28
+ *
 
29
+ * This program is distributed in the hope that it will be useful,
 
30
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
 
31
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
32
+ * GNU General Public License for more details.
 
33
+ *
 
34
+ * You should have received a copy of the GNU General Public License
 
35
+ * along with this program; if not, write to the Free Software
 
36
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
 
37
+ * MA 02111-1307 USA
 
38
+ */
 
39
+
 
40
+
 
41
+#if DEPTH == 8
 
42
+#define PIXEL_TYPE             uint8_t
 
43
+#define COPY_PIXEL1(to, from)  *to ++ = from
 
44
+#elif DEPTH == 15 || DEPTH == 16
 
45
+#define PIXEL_TYPE             uint16_t
 
46
+#define COPY_PIXEL1(to, from)  *to ++ = from
 
47
+#elif DEPTH == 24
 
48
+#define PIXEL_TYPE             uint8_t
 
49
+#define COPY_PIXEL1(to, from)  \
 
50
+    *to ++ = from; *to ++ = (from) >> 8; *to ++ = (from) >> 16
 
51
+#elif DEPTH == 32
 
52
+#define PIXEL_TYPE             uint32_t
 
53
+#define COPY_PIXEL1(to, from)  *to ++ = from
 
54
+#else
 
55
+#error unknown bit depth
 
56
+#endif
 
57
+
 
58
+#ifdef WORDS_BIGENDIAN
 
59
+#define SWAP_WORDS     1
 
60
+#endif
 
61
+
 
62
+static void glue(omap_dss_draw_line1_, DEPTH)(void *opaque,
 
63
+                                              uint8_t *dest_,
 
64
+                                              const uint8_t *src,
 
65
+                                              int width,
 
66
+                                              int pixelsize)
 
67
+{
 
68
+    PIXEL_TYPE *dest = (PIXEL_TYPE *)dest_;
 
69
+    const uint32_t *palette = opaque;
 
70
+    unsigned int r, g, b;
 
71
+    const uint8_t *end = src + (width >> 3);
 
72
+    while (src < end) {
 
73
+        uint8_t data = ldub_raw(src++);
 
74
+        int i = 8;
 
75
+        for (; i--; data <<= 1) {
 
76
+            uint32_t color = palette[data >> 7];
 
77
+            b = color & 0xff;
 
78
+            g = (color >> 8) & 0xff;
 
79
+            r = (color >> 16) & 0xff;
 
80
+            COPY_PIXEL1(dest, glue(rgb_to_pixel, DEPTH)(r, g, b));
 
81
+        }
 
82
+    }
 
83
+}
 
84
+
 
85
+static void glue(omap_dss_draw_line2_, DEPTH)(void *opaque,
 
86
+                                              uint8_t *dest_,
 
87
+                                              const uint8_t *src,
 
88
+                                              int width,
 
89
+                                              int pixelsize)
 
90
+{
 
91
+    PIXEL_TYPE *dest = (PIXEL_TYPE *)dest_;
 
92
+    const uint32_t *palette = opaque;
 
93
+    unsigned int r, g, b;
 
94
+    const uint8_t *end = src + (width >> 2);
 
95
+    while (src < end) {
 
96
+        uint8_t data = ldub_raw(src++);
 
97
+        uint32_t color = palette[data >> 6];
 
98
+        b = color & 0xff;
 
99
+        g = (color >> 8) & 0xff;
 
100
+        r = (color >> 16) & 0xff;
 
101
+        COPY_PIXEL1(dest, glue(rgb_to_pixel, DEPTH)(r, g, b));
 
102
+        color = palette[(data >> 4) & 3];
 
103
+        b = color & 0xff;
 
104
+        g = (color >> 8) & 0xff;
 
105
+        r = (color >> 16) & 0xff;
 
106
+        COPY_PIXEL1(dest, glue(rgb_to_pixel, DEPTH)(r, g, b));
 
107
+        color = palette[(data >> 2) & 3];
 
108
+        b = color & 0xff;
 
109
+        g = (color >> 8) & 0xff;
 
110
+        r = (color >> 16) & 0xff;
 
111
+        COPY_PIXEL1(dest, glue(rgb_to_pixel, DEPTH)(r, g, b));
 
112
+        color = palette[data & 3];
 
113
+        b = color & 0xff;
 
114
+        g = (color >> 8) & 0xff;
 
115
+        r = (color >> 16) & 0xff;
 
116
+        COPY_PIXEL1(dest, glue(rgb_to_pixel, DEPTH)(r, g, b));
 
117
+    }
 
118
+}
 
119
+
 
120
+static void glue(omap_dss_draw_line4_, DEPTH)(void *opaque,
 
121
+                                              uint8_t *dest_,
 
122
+                                              const uint8_t *src,
 
123
+                                              int width,
 
124
+                                              int pixelsize)
 
125
+{
 
126
+    PIXEL_TYPE *dest = (PIXEL_TYPE *)dest_;
 
127
+    const uint32_t *palette = opaque;
 
128
+    unsigned int r, g, b;
 
129
+    const uint8_t *end = src + (width >> 1);
 
130
+    while (src < end) {
 
131
+        uint8_t data = ldub_raw(src++);
 
132
+        uint32_t color = palette[data >> 4];
 
133
+        b = color & 0xff;
 
134
+        g = (color >> 8) & 0xff;
 
135
+        r = (color >> 16) & 0xff;
 
136
+        COPY_PIXEL1(dest, glue(rgb_to_pixel, DEPTH)(r, g, b));
 
137
+        color = palette[data & 0x0f];
 
138
+        b = color & 0xff;
 
139
+        g = (color >> 8) & 0xff;
 
140
+        r = (color >> 16) & 0xff;
 
141
+        COPY_PIXEL1(dest, glue(rgb_to_pixel, DEPTH)(r, g, b));
 
142
+    }
 
143
+}
 
144
+
 
145
+static void glue(omap_dss_draw_line8_, DEPTH)(void *opaque,
 
146
+                                              uint8_t *dest_,
 
147
+                                              const uint8_t *src,
 
148
+                                              int width,
 
149
+                                              int pixelsize)
 
150
+{
 
151
+    PIXEL_TYPE *dest = (PIXEL_TYPE *)dest_;
 
152
+    const uint32_t *palette = opaque;
 
153
+    unsigned int r, g, b;
 
154
+    const uint8_t *end = src + width;
 
155
+    while (src < end) {
 
156
+        uint32_t color = palette[ldub_raw(src++)];
 
157
+        b = color & 0xff;
 
158
+        g = (color >> 8) & 0xff;
 
159
+        r = (color >> 16) & 0xff;
 
160
+        COPY_PIXEL1(dest, glue(rgb_to_pixel, DEPTH)(r, g, b));
 
161
+    }
 
162
+}
 
163
+
 
164
+static void glue(omap_dss_draw_line12_, DEPTH)(void *opaque,
 
165
+                                               uint8_t *dest_,
 
166
+                                               const uint8_t *src_,
 
167
+                                               int width,
 
168
+                                               int pixelsize)
 
169
+{
 
170
+    const uint16_t *src = (const uint16_t *)src_;
 
171
+    PIXEL_TYPE *dest = (PIXEL_TYPE *)dest_;
 
172
+    uint16_t data;
 
173
+    unsigned int r, g, b;
 
174
+    const uint16_t *end = src + width;
 
175
+    while (src < end) {
 
176
+        data = lduw_raw(src++);
 
177
+        b = (data & 0x0f) << 4;
 
178
+        g = (data & 0xf0);
 
179
+        r = (data & 0xf00) >> 4;
 
180
+        COPY_PIXEL1(dest, glue(rgb_to_pixel, DEPTH)(r, g, b));
 
181
+    }
 
182
+}
 
183
+
 
184
+static void glue(omap_dss_draw_line16_, DEPTH)(void *opaque,
 
185
+                                               uint8_t *dest_,
 
186
+                                               const uint8_t *src_,
 
187
+                                               int width,
 
188
+                                               int pixelsize)
 
189
+{
 
190
+#if !defined(SWAP_WORDS) && DEPTH == 16
 
191
+    memcpy(dest_, src_, width << 1);
 
192
+#else
 
193
+    const uint16_t *src = (const uint16_t *)src_;
 
194
+    PIXEL_TYPE *dest = (PIXEL_TYPE *)dest_;
 
195
+    uint16_t data;
 
196
+    unsigned int r, g, b;
 
197
+    const uint16_t *end = src + width;
 
198
+    while (src < end) {
 
199
+        data = lduw_raw(src++);
 
200
+        b = (data & 0x1f) << 3;
 
201
+        g = (data & 0x7e0) >> 3;
 
202
+        r = data >> 8;
 
203
+        COPY_PIXEL1(dest, glue(rgb_to_pixel, DEPTH)(r, g, b));
 
204
+    }
 
205
+#endif
 
206
+}
 
207
+
 
208
+static void glue(omap_dss_draw_line24a_, DEPTH)(void *opaque,
 
209
+                                                uint8_t *dest_,
 
210
+                                                const uint8_t *src,
 
211
+                                                int width,
 
212
+                                                int pixelsize)
 
213
+{
 
214
+#if !defined(SWAP_WORDS) && DEPTH == 32
 
215
+    memcpy(dest_, src, width << 2);
 
216
+#else
 
217
+    PIXEL_TYPE *dest = (PIXEL_TYPE *)dest_;
 
218
+    unsigned int r, g, b;
 
219
+    const uint8_t *end = src + (width << 2);
 
220
+    while (src < end) {
 
221
+        b = ldub_raw(src++);
 
222
+        g = ldub_raw(src++);
 
223
+        r = ldub_raw(src++);
 
224
+        src++;
 
225
+        COPY_PIXEL1(dest, glue(rgb_to_pixel, DEPTH)(r, g, b));
 
226
+    }
 
227
+#endif
 
228
+}
 
229
+
 
230
+static void glue(omap_dss_draw_line24b_, DEPTH)(void *opaque,
 
231
+                                                uint8_t *dest_,
 
232
+                                                const uint8_t *src,
 
233
+                                                int width,
 
234
+                                                int pixelsize)
 
235
+{
 
236
+#if DEPTH == 24
 
237
+    memcpy(dest_, src, width * 3);
 
238
+#else
 
239
+    PIXEL_TYPE *dest = (PIXEL_TYPE *)dest_;
 
240
+    unsigned int r, g, b;
 
241
+    const uint8_t *end = src + width * 3;
 
242
+    while (src < end) {
 
243
+        b = ldub_raw(src++);
 
244
+        g = ldub_raw(src++);
 
245
+        r = ldub_raw(src++);
 
246
+        COPY_PIXEL1(dest, glue(rgb_to_pixel, DEPTH)(r, g, b));
 
247
+    }
 
248
+#endif
 
249
+}
 
250
+
 
251
+static void glue(omap_dss_draw_line24c_, DEPTH)(void *opaque,
 
252
+                                                uint8_t *dest_,
 
253
+                                                const uint8_t *src,
 
254
+                                                int width,
 
255
+                                                int pixelsize)
 
256
+{
 
257
+    PIXEL_TYPE *dest = (PIXEL_TYPE *)dest_;
 
258
+    unsigned int r, g, b;
 
259
+    const uint8_t *end = src + (width << 2);
 
260
+    while (src < end) {
 
261
+        src++;
 
262
+        b = ldub_raw(src++);
 
263
+        g = ldub_raw(src++);
 
264
+        r = ldub_raw(src++);
 
265
+        COPY_PIXEL1(dest, glue(rgb_to_pixel, DEPTH)(r, g, b));
 
266
+    }
 
267
+}
 
268
+
 
269
+/* No rotation */
 
270
+static const drawfn glue(omap_dss_drawfn_, DEPTH)[0x10] = {
 
271
+    (drawfn)glue(omap_dss_draw_line1_, DEPTH),
 
272
+    (drawfn)glue(omap_dss_draw_line2_, DEPTH),
 
273
+    (drawfn)glue(omap_dss_draw_line4_, DEPTH),
 
274
+    (drawfn)glue(omap_dss_draw_line8_, DEPTH),
 
275
+    (drawfn)glue(omap_dss_draw_line12_, DEPTH),
 
276
+    NULL, /* ARGB16 */
 
277
+    (drawfn)glue(omap_dss_draw_line16_, DEPTH),
 
278
+    NULL,
 
279
+    (drawfn)glue(omap_dss_draw_line24a_, DEPTH),
 
280
+    (drawfn)glue(omap_dss_draw_line24b_, DEPTH),
 
281
+    NULL, /* YUV2 4:2:2 */
 
282
+    NULL, /* UYVY 4:2:2 */
 
283
+    (drawfn)glue(omap_dss_draw_line24a_, DEPTH), /* FIXME: handle alpha */
 
284
+    (drawfn)glue(omap_dss_draw_line24c_, DEPTH), /* FIXME: handle alpha */
 
285
+    (drawfn)glue(omap_dss_draw_line24c_, DEPTH),
 
286
+    NULL,
 
287
+};
 
288
+
 
289
+/* 90deg, 180deg and 270deg rotation */
 
290
+//static omap3_lcd_panel_fn_t glue(omap3_lcd_panel_draw_fn_r_, DEPTH)[0x10] = {
 
291
+//    /* TODO */
 
292
+//    [0 ... 0xf] = NULL,
 
293
+//};
 
294
+
 
295
+#undef DEPTH
 
296
+#undef SKIP_PIXEL
 
297
+#undef COPY_PIXEL
 
298
+#undef COPY_PIXEL1
 
299
+#undef PIXEL_TYPE
 
300
+
 
301
+#undef SWAP_WORDS
 
302
-- 
 
303
1.8.5.2
 
304