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

« back to all changes in this revision

Viewing changes to debian/patches/linaro-patches/0001-blizzard-fix-for-non-32bpp-host-displays.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 faa6f88e3ce6776f72d841590bda19c5f8ff4306 Mon Sep 17 00:00:00 2001
 
2
From: Riku Voipio <riku.voipio@nokia.com>
 
3
Date: Mon, 18 Feb 2013 16:58:22 +0000
 
4
Subject: [PATCH 01/71] blizzard: fix for non-32bpp host displays
 
5
 
 
6
TODO: I'm not sure how to trigger this bug, or if the fix is correct
 
7
(the comments say it's a hack)
 
8
---
 
9
 hw/display/blizzard.c | 105 +++++++++++++++++++++++++++-----------------------
 
10
 1 file changed, 57 insertions(+), 48 deletions(-)
 
11
 
 
12
diff --git a/hw/display/blizzard.c b/hw/display/blizzard.c
 
13
index 4a466c8..40f4a5f 100644
 
14
--- a/hw/display/blizzard.c
 
15
+++ b/hw/display/blizzard.c
 
16
@@ -70,7 +70,6 @@ typedef struct {
 
17
     uint8_t iformat;
 
18
     uint8_t source;
 
19
     QemuConsole *con;
 
20
-    blizzard_fn_t *line_fn_tab[2];
 
21
     void *fb;
 
22
 
 
23
     uint8_t hssi_config[3];
 
24
@@ -116,7 +115,6 @@ typedef struct {
 
25
         uint16_t *ptr;
 
26
         int angle;
 
27
         int pitch;
 
28
-        blizzard_fn_t line_fn;
 
29
     } data;
 
30
 } BlizzardState;
 
31
 
 
32
@@ -134,6 +132,17 @@ static const int blizzard_iformat_bpp[0x10] = {
 
33
     0, 0, 0, 0, 0, 0,
 
34
 };
 
35
 
 
36
+#define DEPTH 8
 
37
+#include "blizzard_template.h"
 
38
+#define DEPTH 15
 
39
+#include "blizzard_template.h"
 
40
+#define DEPTH 16
 
41
+#include "blizzard_template.h"
 
42
+#define DEPTH 24
 
43
+#include "blizzard_template.h"
 
44
+#define DEPTH 32
 
45
+#include "blizzard_template.h"
 
46
+
 
47
 static inline void blizzard_rgb2yuv(int r, int g, int b,
 
48
                 int *y, int *u, int *v)
 
49
 {
 
50
@@ -149,8 +158,49 @@ static void blizzard_window(BlizzardState *s)
 
51
     int bypp[2];
 
52
     int bypl[3];
 
53
     int y;
 
54
-    blizzard_fn_t fn = s->data.line_fn;
 
55
+    blizzard_fn_t fn = 0;
 
56
+
 
57
+#if 0
 
58
+    /* FIXME: this is a hack - but nseries.c will use this function
 
59
+     * before correct DisplayState is initialized so we need a way to
 
60
+     * avoid drawing something when we actually have no clue about host bpp */
 
61
+    /* XXX PMM : this is no longer possible after the changes to use
 
62
+     * DisplaySurfaces -- need to check if it is still a problem...
 
63
+     */
 
64
+    if (QLIST_EMPTY(&s->state->listeners)) {
 
65
+        return;
 
66
+    }
 
67
+#endif
 
68
 
 
69
+    switch (surface_bits_per_pixel(surface)) {
 
70
+        case 8:
 
71
+            fn = s->data.angle
 
72
+                ? blizzard_draw_fn_r_8[s->iformat]
 
73
+                : blizzard_draw_fn_8[s->iformat];
 
74
+            break;
 
75
+        case 15:
 
76
+            fn = s->data.angle
 
77
+                ? blizzard_draw_fn_r_15[s->iformat]
 
78
+                : blizzard_draw_fn_15[s->iformat];
 
79
+            break;
 
80
+        case 16:
 
81
+            fn = s->data.angle
 
82
+                ? blizzard_draw_fn_r_16[s->iformat]
 
83
+                : blizzard_draw_fn_16[s->iformat];
 
84
+            break;
 
85
+        case 24:
 
86
+            fn = s->data.angle
 
87
+                ? blizzard_draw_fn_r_24[s->iformat]
 
88
+                : blizzard_draw_fn_24[s->iformat];
 
89
+            break;
 
90
+        case 32:
 
91
+            fn = s->data.angle
 
92
+                ? blizzard_draw_fn_r_32[s->iformat]
 
93
+                : blizzard_draw_fn_32[s->iformat];
 
94
+            break;
 
95
+        default:
 
96
+               break;
 
97
+    }
 
98
     if (!fn)
 
99
         return;
 
100
     if (s->mx[0] > s->data.x)
 
101
@@ -181,7 +231,6 @@ static int blizzard_transfer_setup(BlizzardState *s)
 
102
         return 0;
 
103
 
 
104
     s->data.angle = s->effect & 3;
 
105
-    s->data.line_fn = s->line_fn_tab[!!s->data.angle][s->iformat];
 
106
     s->data.x = s->ix[0];
 
107
     s->data.y = s->iy[0];
 
108
     s->data.dx = s->ix[1] - s->ix[0] + 1;
 
109
@@ -933,17 +982,6 @@ static void blizzard_update_display(void *opaque)
 
110
     s->my[1] = 0;
 
111
 }
 
112
 
 
113
-#define DEPTH 8
 
114
-#include "blizzard_template.h"
 
115
-#define DEPTH 15
 
116
-#include "blizzard_template.h"
 
117
-#define DEPTH 16
 
118
-#include "blizzard_template.h"
 
119
-#define DEPTH 24
 
120
-#include "blizzard_template.h"
 
121
-#define DEPTH 32
 
122
-#include "blizzard_template.h"
 
123
-
 
124
 static const GraphicHwOps blizzard_ops = {
 
125
     .invalidate  = blizzard_invalidate_display,
 
126
     .gfx_update  = blizzard_update_display,
 
127
@@ -952,44 +990,15 @@ static const GraphicHwOps blizzard_ops = {
 
128
 void *s1d13745_init(qemu_irq gpio_int)
 
129
 {
 
130
     BlizzardState *s = (BlizzardState *) g_malloc0(sizeof(*s));
 
131
-    DisplaySurface *surface;
 
132
 
 
133
     s->fb = g_malloc(0x180000);
 
134
+    /* Fill the framebuffer with white color here because the corresponding
 
135
+     * code in nseries.c is broken since the DisplayState change in QEMU.
 
136
+     * This is supposedly ok since nseries.c is the only user of blizzard.c */
 
137
+    memset(s->fb, 0xff, 0x180000);
 
138
 
 
139
     s->con = graphic_console_init(NULL, &blizzard_ops, s);
 
140
-    surface = qemu_console_surface(s->con);
 
141
-
 
142
-    switch (surface_bits_per_pixel(surface)) {
 
143
-    case 0:
 
144
-        s->line_fn_tab[0] = s->line_fn_tab[1] =
 
145
-                g_malloc0(sizeof(blizzard_fn_t) * 0x10);
 
146
-        break;
 
147
-    case 8:
 
148
-        s->line_fn_tab[0] = blizzard_draw_fn_8;
 
149
-        s->line_fn_tab[1] = blizzard_draw_fn_r_8;
 
150
-        break;
 
151
-    case 15:
 
152
-        s->line_fn_tab[0] = blizzard_draw_fn_15;
 
153
-        s->line_fn_tab[1] = blizzard_draw_fn_r_15;
 
154
-        break;
 
155
-    case 16:
 
156
-        s->line_fn_tab[0] = blizzard_draw_fn_16;
 
157
-        s->line_fn_tab[1] = blizzard_draw_fn_r_16;
 
158
-        break;
 
159
-    case 24:
 
160
-        s->line_fn_tab[0] = blizzard_draw_fn_24;
 
161
-        s->line_fn_tab[1] = blizzard_draw_fn_r_24;
 
162
-        break;
 
163
-    case 32:
 
164
-        s->line_fn_tab[0] = blizzard_draw_fn_32;
 
165
-        s->line_fn_tab[1] = blizzard_draw_fn_r_32;
 
166
-        break;
 
167
-    default:
 
168
-        fprintf(stderr, "%s: Bad color depth\n", __FUNCTION__);
 
169
-        exit(1);
 
170
-    }
 
171
 
 
172
     blizzard_reset(s);
 
173
-
 
174
     return s;
 
175
 }
 
176
-- 
 
177
1.8.3.2
 
178