~ubuntu-branches/ubuntu/vivid/qemu/vivid

« back to all changes in this revision

Viewing changes to hw/display/blizzard.c

  • Committer: Package Import Robot
  • Author(s): Serge Hallyn
  • Date: 2014-02-25 22:31:43 UTC
  • mfrom: (1.8.5)
  • Revision ID: package-import@ubuntu.com-20140225223143-odhqxfc60wxrjl15
Tags: 2.0.0~rc1+dfsg-0ubuntu1
* Merge 2.0.0-rc1
* debian/rules: consolidate ppc filter entries.
* Move qemu-system-arch64 into qemu-system-arm
* debian/patches/define-trusty-machine-type.patch: define a trusty machine
  type, currently the same as pc-i440fx-2.0, to put is in a better position
  to enable live migrations from trusty onward.  (LP: #1294823)
* debian/control: build-dep on libfdt >= 1.4.0  (LP: #1295072)
* Merge latest upstream git to commit dc9528f
* Debian/rules:
  - remove -enable-uname-release=2.6.32
  - don't make the aarch64 target Ubuntu-specific.
* Remove patches which are now upstream:
  - fix-smb-security-share.patch
  - slirp-smb-redirect-port-445-too.patch 
  - linux-user-Implement-sendmmsg-syscall.patch (better version is upstream)
  - signal-added-a-wrapper-for-sigprocmask-function.patch
  - ubuntu/signal-sigsegv-protection-on-do_sigprocmask.patch
  - ubuntu/Don-t-block-SIGSEGV-at-more-places.patch
  - ubuntu/ppc-force-cpu-threads-count-to-be-power-of-2.patch
* add link for /usr/share/qemu/bios-256k.bin
* Remove all linaro patches.
* Remove all arm64/ patches.  Many but not all are upstream.
* Remove CVE-2013-4377.patch which is upstream.
* debian/control-in: don't make qemu-system-aarch64 ubuntu-specific

Show diffs side-by-side

added added

removed removed

Lines of Context:
70
70
    uint8_t iformat;
71
71
    uint8_t source;
72
72
    QemuConsole *con;
 
73
    blizzard_fn_t *line_fn_tab[2];
73
74
    void *fb;
74
75
 
75
76
    uint8_t hssi_config[3];
115
116
        uint16_t *ptr;
116
117
        int angle;
117
118
        int pitch;
 
119
        blizzard_fn_t line_fn;
118
120
    } data;
119
121
} BlizzardState;
120
122
 
132
134
    0, 0, 0, 0, 0, 0,
133
135
};
134
136
 
135
 
#define DEPTH 8
136
 
#include "blizzard_template.h"
137
 
#define DEPTH 15
138
 
#include "blizzard_template.h"
139
 
#define DEPTH 16
140
 
#include "blizzard_template.h"
141
 
#define DEPTH 24
142
 
#include "blizzard_template.h"
143
 
#define DEPTH 32
144
 
#include "blizzard_template.h"
145
 
 
146
137
static inline void blizzard_rgb2yuv(int r, int g, int b,
147
138
                int *y, int *u, int *v)
148
139
{
158
149
    int bypp[2];
159
150
    int bypl[3];
160
151
    int y;
161
 
    blizzard_fn_t fn = 0;
162
 
 
163
 
#if 0
164
 
    /* FIXME: this is a hack - but nseries.c will use this function
165
 
     * before correct DisplayState is initialized so we need a way to
166
 
     * avoid drawing something when we actually have no clue about host bpp */
167
 
    /* XXX PMM : this is no longer possible after the changes to use
168
 
     * DisplaySurfaces -- need to check if it is still a problem...
169
 
     */
170
 
    if (QLIST_EMPTY(&s->state->listeners)) {
171
 
        return;
172
 
    }
173
 
#endif
174
 
 
175
 
    switch (surface_bits_per_pixel(surface)) {
176
 
        case 8:
177
 
            fn = s->data.angle
178
 
                ? blizzard_draw_fn_r_8[s->iformat]
179
 
                : blizzard_draw_fn_8[s->iformat];
180
 
            break;
181
 
        case 15:
182
 
            fn = s->data.angle
183
 
                ? blizzard_draw_fn_r_15[s->iformat]
184
 
                : blizzard_draw_fn_15[s->iformat];
185
 
            break;
186
 
        case 16:
187
 
            fn = s->data.angle
188
 
                ? blizzard_draw_fn_r_16[s->iformat]
189
 
                : blizzard_draw_fn_16[s->iformat];
190
 
            break;
191
 
        case 24:
192
 
            fn = s->data.angle
193
 
                ? blizzard_draw_fn_r_24[s->iformat]
194
 
                : blizzard_draw_fn_24[s->iformat];
195
 
            break;
196
 
        case 32:
197
 
            fn = s->data.angle
198
 
                ? blizzard_draw_fn_r_32[s->iformat]
199
 
                : blizzard_draw_fn_32[s->iformat];
200
 
            break;
201
 
        default:
202
 
                break;
203
 
    }
 
152
    blizzard_fn_t fn = s->data.line_fn;
 
153
 
204
154
    if (!fn)
205
155
        return;
206
156
    if (s->mx[0] > s->data.x)
231
181
        return 0;
232
182
 
233
183
    s->data.angle = s->effect & 3;
 
184
    s->data.line_fn = s->line_fn_tab[!!s->data.angle][s->iformat];
234
185
    s->data.x = s->ix[0];
235
186
    s->data.y = s->iy[0];
236
187
    s->data.dx = s->ix[1] - s->ix[0] + 1;
982
933
    s->my[1] = 0;
983
934
}
984
935
 
 
936
#define DEPTH 8
 
937
#include "blizzard_template.h"
 
938
#define DEPTH 15
 
939
#include "blizzard_template.h"
 
940
#define DEPTH 16
 
941
#include "blizzard_template.h"
 
942
#define DEPTH 24
 
943
#include "blizzard_template.h"
 
944
#define DEPTH 32
 
945
#include "blizzard_template.h"
 
946
 
985
947
static const GraphicHwOps blizzard_ops = {
986
948
    .invalidate  = blizzard_invalidate_display,
987
949
    .gfx_update  = blizzard_update_display,
990
952
void *s1d13745_init(qemu_irq gpio_int)
991
953
{
992
954
    BlizzardState *s = (BlizzardState *) g_malloc0(sizeof(*s));
 
955
    DisplaySurface *surface;
993
956
 
994
957
    s->fb = g_malloc(0x180000);
995
 
    /* Fill the framebuffer with white color here because the corresponding
996
 
     * code in nseries.c is broken since the DisplayState change in QEMU.
997
 
     * This is supposedly ok since nseries.c is the only user of blizzard.c */
998
 
    memset(s->fb, 0xff, 0x180000);
999
 
 
1000
 
    s->con = graphic_console_init(NULL, &blizzard_ops, s);
 
958
 
 
959
    s->con = graphic_console_init(NULL, 0, &blizzard_ops, s);
 
960
    surface = qemu_console_surface(s->con);
 
961
 
 
962
    switch (surface_bits_per_pixel(surface)) {
 
963
    case 0:
 
964
        s->line_fn_tab[0] = s->line_fn_tab[1] =
 
965
                g_malloc0(sizeof(blizzard_fn_t) * 0x10);
 
966
        break;
 
967
    case 8:
 
968
        s->line_fn_tab[0] = blizzard_draw_fn_8;
 
969
        s->line_fn_tab[1] = blizzard_draw_fn_r_8;
 
970
        break;
 
971
    case 15:
 
972
        s->line_fn_tab[0] = blizzard_draw_fn_15;
 
973
        s->line_fn_tab[1] = blizzard_draw_fn_r_15;
 
974
        break;
 
975
    case 16:
 
976
        s->line_fn_tab[0] = blizzard_draw_fn_16;
 
977
        s->line_fn_tab[1] = blizzard_draw_fn_r_16;
 
978
        break;
 
979
    case 24:
 
980
        s->line_fn_tab[0] = blizzard_draw_fn_24;
 
981
        s->line_fn_tab[1] = blizzard_draw_fn_r_24;
 
982
        break;
 
983
    case 32:
 
984
        s->line_fn_tab[0] = blizzard_draw_fn_32;
 
985
        s->line_fn_tab[1] = blizzard_draw_fn_r_32;
 
986
        break;
 
987
    default:
 
988
        fprintf(stderr, "%s: Bad color depth\n", __FUNCTION__);
 
989
        exit(1);
 
990
    }
1001
991
 
1002
992
    blizzard_reset(s);
 
993
 
1003
994
    return s;
1004
995
}