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

« back to all changes in this revision

Viewing changes to debian/patches/ubuntu/linaro/0001-blizzard-fix-for-non-32bpp-host-displays.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 ca727af0d4ae4076042a240e1112f4475de086ab 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/70] 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.5.2
 
178