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

« back to all changes in this revision

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

  • Committer: Package Import Robot
  • Author(s): Serge Hallyn
  • Date: 2013-10-22 22:47:07 UTC
  • mfrom: (1.8.3) (10.1.42 sid)
  • Revision ID: package-import@ubuntu.com-20131022224707-1lya34fw3k3f24tv
Tags: 1.6.0+dfsg-2ubuntu1
* Merge 1.6.0~rc0+dfsg-2exp from debian experimental.  Remaining changes:
  - debian/control
    * update maintainer
    * remove libiscsi, usb-redir, vde, vnc-jpeg, and libssh2-1-dev
      from build-deps
    * enable rbd
    * add qemu-system and qemu-common B/R to qemu-keymaps
    * add D:udev, R:qemu, R:qemu-common and B:qemu-common to
      qemu-system-common
    * qemu-system-arm, qemu-system-ppc, qemu-system-sparc:
      - add qemu-kvm to Provides
      - add qemu-common, qemu-kvm, kvm to B/R
      - remove openbios-sparc from qemu-system-sparc D
      - drop openbios-ppc and openhackware Depends to Suggests (for now)
    * qemu-system-x86:
      - add qemu-common to Breaks/Replaces.
      - add cpu-checker to Recommends.
    * qemu-user: add B/R:qemu-kvm
    * qemu-kvm:
      - add armhf armel powerpc sparc to Architecture
      - C/R/P: qemu-kvm-spice
    * add qemu-common package
    * drop qemu-slof which is not packaged in ubuntu
  - add qemu-system-common.links for tap ifup/down scripts and OVMF link.
  - qemu-system-x86.links:
    * remove pxe rom links which are in kvm-ipxe
    * add symlink for kvm.1 manpage
  - debian/rules
    * add kvm-spice symlink to qemu-kvm
    * call dh_installmodules for qemu-system-x86
    * update dh_installinit to install upstart script
    * run dh_installman (Closes: #709241) (cherrypicked from 1.5.0+dfsg-2)
  - Add qemu-utils.links for kvm-* symlinks.
  - Add qemu-system-x86.qemu-kvm.upstart and .default
  - Add qemu-system-x86.modprobe to set nesting=1
  - Add qemu-system-common.preinst to add kvm group
  - qemu-system-common.postinst: remove bad group acl if there, then have
    udev relabel /dev/kvm.
  - New linaro patches from qemu-linaro rebasing branch
  - Dropped patches:
    * xen-simplify-xen_enabled.patch
    * sparc-linux-user-fix-missing-symbols-in-.rel-.rela.plt-sections.patch
    * main_loop-do-not-set-nonblocking-if-xen_enabled.patch
    * xen_machine_pv-do-not-create-a-dummy-CPU-in-machine-.patch
    * virtio-rng-fix-crash
  - Kept patches:
    * expose_vms_qemu64cpu.patch - updated
    * linaro arm patches from qemu-linaro rebasing branch
  - New patches:
    * fix-pci-add: change CONFIG variable in ifdef to make sure that
      pci_add is defined.
* Add linaro patches
* Add experimental mach-virt patches for arm virtualization.
* qemu-system-common.install: add debian/tmp/usr/lib to install the
  qemu-bridge-helper

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
From f931af41957111303396562cd6316eba8681611d 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/69] 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
 
1.8.1.2
303