Revision c78f7137 hw/pl110.c
b/hw/pl110.c | ||
---|---|---|
42 | 42 |
typedef struct { |
43 | 43 |
SysBusDevice busdev; |
44 | 44 |
MemoryRegion iomem; |
45 |
DisplayState *ds;
|
|
45 |
QemuConsole *con;
|
|
46 | 46 |
|
47 | 47 |
int version; |
48 | 48 |
uint32_t timing[4]; |
... | ... | |
129 | 129 |
static void pl110_update_display(void *opaque) |
130 | 130 |
{ |
131 | 131 |
pl110_state *s = (pl110_state *)opaque; |
132 |
DisplaySurface *surface = qemu_console_surface(s->con); |
|
132 | 133 |
drawfn* fntable; |
133 | 134 |
drawfn fn; |
134 | 135 |
int dest_width; |
... | ... | |
140 | 141 |
if (!pl110_enabled(s)) |
141 | 142 |
return; |
142 | 143 |
|
143 |
switch (ds_get_bits_per_pixel(s->ds)) {
|
|
144 |
switch (surface_bits_per_pixel(surface)) {
|
|
144 | 145 |
case 0: |
145 | 146 |
return; |
146 | 147 |
case 8: |
... | ... | |
231 | 232 |
} |
232 | 233 |
dest_width *= s->cols; |
233 | 234 |
first = 0; |
234 |
framebuffer_update_display(s->ds, sysbus_address_space(&s->busdev),
|
|
235 |
framebuffer_update_display(surface, sysbus_address_space(&s->busdev),
|
|
235 | 236 |
s->upbase, s->cols, s->rows, |
236 | 237 |
src_width, dest_width, 0, |
237 | 238 |
s->invalidate, |
238 | 239 |
fn, s->palette, |
239 | 240 |
&first, &last); |
240 | 241 |
if (first >= 0) { |
241 |
dpy_gfx_update(s->ds, 0, first, s->cols, last - first + 1);
|
|
242 |
dpy_gfx_update(s->con, 0, first, s->cols, last - first + 1);
|
|
242 | 243 |
} |
243 | 244 |
s->invalidate = 0; |
244 | 245 |
} |
... | ... | |
248 | 249 |
pl110_state *s = (pl110_state *)opaque; |
249 | 250 |
s->invalidate = 1; |
250 | 251 |
if (pl110_enabled(s)) { |
251 |
qemu_console_resize(s->ds, s->cols, s->rows);
|
|
252 |
qemu_console_resize(s->con, s->cols, s->rows);
|
|
252 | 253 |
} |
253 | 254 |
} |
254 | 255 |
|
255 | 256 |
static void pl110_update_palette(pl110_state *s, int n) |
256 | 257 |
{ |
258 |
DisplaySurface *surface = qemu_console_surface(s->con); |
|
257 | 259 |
int i; |
258 | 260 |
uint32_t raw; |
259 | 261 |
unsigned int r, g, b; |
... | ... | |
268 | 270 |
b = (raw & 0x1f) << 3; |
269 | 271 |
/* The I bit is ignored. */ |
270 | 272 |
raw >>= 6; |
271 |
switch (ds_get_bits_per_pixel(s->ds)) {
|
|
273 |
switch (surface_bits_per_pixel(surface)) {
|
|
272 | 274 |
case 8: |
273 | 275 |
s->palette[n] = rgb_to_pixel8(r, g, b); |
274 | 276 |
break; |
... | ... | |
291 | 293 |
{ |
292 | 294 |
if (width != s->cols || height != s->rows) { |
293 | 295 |
if (pl110_enabled(s)) { |
294 |
qemu_console_resize(s->ds, width, height);
|
|
296 |
qemu_console_resize(s->con, width, height);
|
|
295 | 297 |
} |
296 | 298 |
} |
297 | 299 |
s->cols = width; |
... | ... | |
409 | 411 |
s->cr = val; |
410 | 412 |
s->bpp = (val >> 1) & 7; |
411 | 413 |
if (pl110_enabled(s)) { |
412 |
qemu_console_resize(s->ds, s->cols, s->rows);
|
|
414 |
qemu_console_resize(s->con, s->cols, s->rows);
|
|
413 | 415 |
} |
414 | 416 |
break; |
415 | 417 |
case 10: /* LCDICR */ |
... | ... | |
450 | 452 |
sysbus_init_mmio(dev, &s->iomem); |
451 | 453 |
sysbus_init_irq(dev, &s->irq); |
452 | 454 |
qdev_init_gpio_in(&s->busdev.qdev, pl110_mux_ctrl_set, 1); |
453 |
s->ds = graphic_console_init(pl110_update_display,
|
|
454 |
pl110_invalidate_display, |
|
455 |
NULL, NULL, s); |
|
455 |
s->con = graphic_console_init(pl110_update_display,
|
|
456 |
pl110_invalidate_display,
|
|
457 |
NULL, NULL, s);
|
|
456 | 458 |
return 0; |
457 | 459 |
} |
458 | 460 |
|
Also available in: Unified diff