aboutsummaryrefslogtreecommitdiff
path: root/hw
diff options
context:
space:
mode:
authorAnthony Liguori <aliguori@us.ibm.com>2012-11-01 11:14:39 -0500
committerAnthony Liguori <aliguori@us.ibm.com>2012-11-01 11:14:39 -0500
commit4ba79505f43bd0ace35c3fe42197eb02e7e0478e (patch)
treeeb1ecd216c1134a88ac0e2d3bc7185319c82fb95 /hw
parentd971919f08ca300e7b3595a4c5ddaea2ce8fc3ba (diff)
parent64f735920ad319aee860e56bb9bad6cfccf4ad40 (diff)
Merge remote-tracking branch 'kraxel/pixman.v3' into staging
* kraxel/pixman.v3: (22 commits) pixman: drop obsolete fields from DisplaySurface pixman/vnc: remove dead code. pixman/vnc: remove rgb_prepare_row* functions pixman/vnc: use pixman images in vnc. pixman: switch screendump function. vga: stop direct access to DisplaySurface fields. qxl: stop direct access to DisplaySurface fields. console: don't set PixelFormat alpha fields for 32bpp console: make qemu_alloc_display static pixman: add pixman image to DisplaySurface pixman: helper functions pixman: windup in configure & makefiles pixman: add submodule console: remove DisplayAllocator console: remove dpy_gfx_fill vga: fix text mode updating console: init displaychangelisteners on register console: untangle gfx & txt updates console: s/TextConsole/QemuConsole/ console: move set_mouse + cursor_define callbacks ... Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'hw')
-rw-r--r--hw/blizzard.c4
-rw-r--r--hw/exynos4210_fimd.c2
-rw-r--r--hw/g364fb.c7
-rw-r--r--hw/jazz_led.c6
-rw-r--r--hw/milkymist-vgafb.c2
-rw-r--r--hw/musicpal.c2
-rw-r--r--hw/nseries.c2
-rw-r--r--hw/omap_lcdc.c2
-rw-r--r--hw/palm.c2
-rw-r--r--hw/pl110.c2
-rw-r--r--hw/pxa2xx_lcd.c8
-rw-r--r--hw/qxl-render.c14
-rw-r--r--hw/qxl.c4
-rw-r--r--hw/sm501.c4
-rw-r--r--hw/ssd0303.c2
-rw-r--r--hw/ssd0323.c2
-rw-r--r--hw/tc6393xb.c4
-rw-r--r--hw/tcx.c16
-rw-r--r--hw/vga.c111
-rw-r--r--hw/vga_int.h2
-rw-r--r--hw/vmware_vga.c15
-rw-r--r--hw/xenfb.c2
22 files changed, 111 insertions, 104 deletions
diff --git a/hw/blizzard.c b/hw/blizzard.c
index 06e19b364b..1b57eb5396 100644
--- a/hw/blizzard.c
+++ b/hw/blizzard.c
@@ -921,8 +921,8 @@ static void blizzard_update_display(void *opaque)
for (; y < s->my[1]; y ++, src += bypl, dst += bypl)
memcpy(dst, src, bwidth);
- dpy_update(s->state, s->mx[0], s->my[0],
- s->mx[1] - s->mx[0], y - s->my[0]);
+ dpy_gfx_update(s->state, s->mx[0], s->my[0],
+ s->mx[1] - s->mx[0], y - s->my[0]);
s->mx[0] = s->x;
s->mx[1] = 0;
diff --git a/hw/exynos4210_fimd.c b/hw/exynos4210_fimd.c
index 7cb2c31bee..f2443ca4af 100644
--- a/hw/exynos4210_fimd.c
+++ b/hw/exynos4210_fimd.c
@@ -1307,7 +1307,7 @@ static void exynos4210_fimd_update(void *opaque)
fimd_copy_line_toqemu(global_width, s->ifb + global_width * line *
RGBA_SIZE, d + global_width * line * bpp);
}
- dpy_update(s->console, 0, 0, global_width, global_height);
+ dpy_gfx_update(s->console, 0, 0, global_width, global_height);
}
s->invalidate = false;
s->vidintcon[1] |= FIMD_VIDINT_INTFRMPEND;
diff --git a/hw/g364fb.c b/hw/g364fb.c
index f7b4bf5ae2..8192baf1c8 100644
--- a/hw/g364fb.c
+++ b/hw/g364fb.c
@@ -197,7 +197,8 @@ static void g364fb_draw_graphic8(G364State *s)
reset_dirty(s, page_min, page_max);
page_min = (ram_addr_t)-1;
page_max = 0;
- dpy_update(s->ds, xmin, ymin, xmax - xmin + 1, ymax - ymin + 1);
+ dpy_gfx_update(s->ds, xmin, ymin,
+ xmax - xmin + 1, ymax - ymin + 1);
xmin = s->width;
xmax = 0;
ymin = s->height;
@@ -216,7 +217,7 @@ static void g364fb_draw_graphic8(G364State *s)
done:
if (page_min != (ram_addr_t)-1) {
- dpy_update(s->ds, xmin, ymin, xmax - xmin + 1, ymax - ymin + 1);
+ dpy_gfx_update(s->ds, xmin, ymin, xmax - xmin + 1, ymax - ymin + 1);
reset_dirty(s, page_min, page_max);
}
}
@@ -238,7 +239,7 @@ static void g364fb_draw_blank(G364State *s)
d += ds_get_linesize(s->ds);
}
- dpy_update(s->ds, 0, 0, s->width, s->height);
+ dpy_gfx_update(s->ds, 0, 0, s->width, s->height);
s->blanked = 1;
}
diff --git a/hw/jazz_led.c b/hw/jazz_led.c
index a6a90ab283..640e75ef2f 100644
--- a/hw/jazz_led.c
+++ b/hw/jazz_led.c
@@ -196,7 +196,7 @@ static void jazz_led_update_display(void *opaque)
}
s->state = REDRAW_NONE;
- dpy_update(ds, 0, 0, ds_get_width(ds), ds_get_height(ds));
+ dpy_gfx_update(ds, 0, 0, ds_get_width(ds), ds_get_height(ds));
}
static void jazz_led_invalidate_display(void *opaque)
@@ -210,7 +210,7 @@ static void jazz_led_text_update(void *opaque, console_ch_t *chardata)
LedState *s = opaque;
char buf[2];
- dpy_cursor(s->ds, -1, -1);
+ dpy_text_cursor(s->ds, -1, -1);
qemu_console_resize(s->ds, 2, 1);
/* TODO: draw the segments */
@@ -218,7 +218,7 @@ static void jazz_led_text_update(void *opaque, console_ch_t *chardata)
console_write_ch(chardata++, 0x00200100 | buf[0]);
console_write_ch(chardata++, 0x00200100 | buf[1]);
- dpy_update(s->ds, 0, 0, 2, 1);
+ dpy_text_update(s->ds, 0, 0, 2, 1);
}
static int jazz_led_post_load(void *opaque, int version_id)
diff --git a/hw/milkymist-vgafb.c b/hw/milkymist-vgafb.c
index 8d36bc10f6..833881cc6a 100644
--- a/hw/milkymist-vgafb.c
+++ b/hw/milkymist-vgafb.c
@@ -134,7 +134,7 @@ static void vgafb_update_display(void *opaque)
&first, &last);
if (first >= 0) {
- dpy_update(s->ds, 0, first, s->regs[R_HRES], last - first + 1);
+ dpy_gfx_update(s->ds, 0, first, s->regs[R_HRES], last - first + 1);
}
s->invalidate = 0;
}
diff --git a/hw/musicpal.c b/hw/musicpal.c
index beec76bf38..e0c57c84eb 100644
--- a/hw/musicpal.c
+++ b/hw/musicpal.c
@@ -526,7 +526,7 @@ static void lcd_refresh(void *opaque)
ds_get_bits_per_pixel(s->ds));
}
- dpy_update(s->ds, 0, 0, 128*3, 64*3);
+ dpy_gfx_update(s->ds, 0, 0, 128*3, 64*3);
}
static void lcd_invalidate(void *opaque)
diff --git a/hw/nseries.c b/hw/nseries.c
index 652d9da333..2de8d21f08 100644
--- a/hw/nseries.c
+++ b/hw/nseries.c
@@ -1375,7 +1375,7 @@ static void n8x0_init(QEMUMachineInitArgs *args,
size until the guest activates the display. */
ds = get_displaystate();
ds->surface = qemu_resize_displaysurface(ds, 800, 480);
- dpy_resize(ds);
+ dpy_gfx_resize(ds);
}
static struct arm_boot_info n800_binfo = {
diff --git a/hw/omap_lcdc.c b/hw/omap_lcdc.c
index bf177c22dd..d7ae3032be 100644
--- a/hw/omap_lcdc.c
+++ b/hw/omap_lcdc.c
@@ -219,7 +219,7 @@ static void omap_update_display(void *opaque)
draw_line, omap_lcd->palette,
&first, &last);
if (first >= 0) {
- dpy_update(omap_lcd->state, 0, first, width, last - first + 1);
+ dpy_gfx_update(omap_lcd->state, 0, first, width, last - first + 1);
}
omap_lcd->invalidate = 0;
}
diff --git a/hw/palm.c b/hw/palm.c
index d26305159d..6f6f414e6e 100644
--- a/hw/palm.c
+++ b/hw/palm.c
@@ -273,7 +273,7 @@ static void palmte_init(QEMUMachineInitArgs *args)
will set the size once configured, so this just sets an initial
size until the guest activates the display. */
ds->surface = qemu_resize_displaysurface(ds, 320, 320);
- dpy_resize(ds);
+ dpy_gfx_resize(ds);
}
static QEMUMachine palmte_machine = {
diff --git a/hw/pl110.c b/hw/pl110.c
index d5472f4cce..f869ba60d7 100644
--- a/hw/pl110.c
+++ b/hw/pl110.c
@@ -239,7 +239,7 @@ static void pl110_update_display(void *opaque)
fn, s->palette,
&first, &last);
if (first >= 0) {
- dpy_update(s->ds, 0, first, s->cols, last - first + 1);
+ dpy_gfx_update(s->ds, 0, first, s->cols, last - first + 1);
}
s->invalidate = 0;
}
diff --git a/hw/pxa2xx_lcd.c b/hw/pxa2xx_lcd.c
index 38c38890c9..b53dfaf3cf 100644
--- a/hw/pxa2xx_lcd.c
+++ b/hw/pxa2xx_lcd.c
@@ -871,20 +871,20 @@ static void pxa2xx_update_display(void *opaque)
if (miny >= 0) {
switch (s->orientation) {
case 0:
- dpy_update(s->ds, 0, miny, s->xres, maxy - miny + 1);
+ dpy_gfx_update(s->ds, 0, miny, s->xres, maxy - miny + 1);
break;
case 90:
- dpy_update(s->ds, miny, 0, maxy - miny + 1, s->xres);
+ dpy_gfx_update(s->ds, miny, 0, maxy - miny + 1, s->xres);
break;
case 180:
maxy = s->yres - maxy - 1;
miny = s->yres - miny - 1;
- dpy_update(s->ds, 0, maxy, s->xres, miny - maxy + 1);
+ dpy_gfx_update(s->ds, 0, maxy, s->xres, miny - maxy + 1);
break;
case 270:
maxy = s->yres - maxy - 1;
miny = s->yres - miny - 1;
- dpy_update(s->ds, maxy, 0, miny - maxy + 1, s->xres);
+ dpy_gfx_update(s->ds, maxy, 0, miny - maxy + 1, s->xres);
break;
}
}
diff --git a/hw/qxl-render.c b/hw/qxl-render.c
index b66c168ef6..98ecb21405 100644
--- a/hw/qxl-render.c
+++ b/hw/qxl-render.c
@@ -24,7 +24,7 @@
static void qxl_blit(PCIQXLDevice *qxl, QXLRect *rect)
{
uint8_t *src;
- uint8_t *dst = qxl->vga.ds->surface->data;
+ uint8_t *dst = ds_get_data(qxl->vga.ds);
int len, i;
if (is_buffer_shared(qxl->vga.ds->surface)) {
@@ -123,17 +123,17 @@ static void qxl_render_update_area_unlocked(PCIQXLDevice *qxl)
qxl->guest_primary.surface.width,
qxl->guest_primary.surface.height);
}
- dpy_resize(vga->ds);
+ dpy_gfx_resize(vga->ds);
}
for (i = 0; i < qxl->num_dirty_rects; i++) {
if (qemu_spice_rect_is_empty(qxl->dirty+i)) {
break;
}
qxl_blit(qxl, qxl->dirty+i);
- dpy_update(vga->ds,
- qxl->dirty[i].left, qxl->dirty[i].top,
- qxl->dirty[i].right - qxl->dirty[i].left,
- qxl->dirty[i].bottom - qxl->dirty[i].top);
+ dpy_gfx_update(vga->ds,
+ qxl->dirty[i].left, qxl->dirty[i].top,
+ qxl->dirty[i].right - qxl->dirty[i].left,
+ qxl->dirty[i].bottom - qxl->dirty[i].top);
}
qxl->num_dirty_rects = 0;
}
@@ -234,7 +234,7 @@ int qxl_render_cursor(PCIQXLDevice *qxl, QXLCommandExt *ext)
return 1;
}
- if (!qxl->ssd.ds->mouse_set || !qxl->ssd.ds->cursor_define) {
+ if (!dpy_cursor_define_supported(qxl->ssd.ds)) {
return 0;
}
diff --git a/hw/qxl.c b/hw/qxl.c
index d54daf6d3b..1f56fcd169 100644
--- a/hw/qxl.c
+++ b/hw/qxl.c
@@ -1864,8 +1864,8 @@ static void display_refresh(struct DisplayState *ds)
}
static DisplayChangeListener display_listener = {
- .dpy_update = display_update,
- .dpy_resize = display_resize,
+ .dpy_gfx_update = display_update,
+ .dpy_gfx_resize = display_resize,
.dpy_refresh = display_refresh,
};
diff --git a/hw/sm501.c b/hw/sm501.c
index 4aafe49cce..50324cda53 100644
--- a/hw/sm501.c
+++ b/hw/sm501.c
@@ -1351,7 +1351,7 @@ static void sm501_draw_crt(SM501State * s)
} else {
if (y_start >= 0) {
/* flush to display */
- dpy_update(s->ds, 0, y_start, width, y - y_start);
+ dpy_gfx_update(s->ds, 0, y_start, width, y - y_start);
y_start = -1;
}
}
@@ -1362,7 +1362,7 @@ static void sm501_draw_crt(SM501State * s)
/* complete flush to display */
if (y_start >= 0)
- dpy_update(s->ds, 0, y_start, width, y - y_start);
+ dpy_gfx_update(s->ds, 0, y_start, width, y - y_start);
/* clear dirty flags */
if (page_min != ~0l) {
diff --git a/hw/ssd0303.c b/hw/ssd0303.c
index 4e1ee6e12b..d7fd828c65 100644
--- a/hw/ssd0303.c
+++ b/hw/ssd0303.c
@@ -252,7 +252,7 @@ static void ssd0303_update_display(void *opaque)
}
}
s->redraw = 0;
- dpy_update(s->ds, 0, 0, 96 * MAGNIFY, 16 * MAGNIFY);
+ dpy_gfx_update(s->ds, 0, 0, 96 * MAGNIFY, 16 * MAGNIFY);
}
static void ssd0303_invalidate_display(void * opaque)
diff --git a/hw/ssd0323.c b/hw/ssd0323.c
index 9c42d648e2..4098830c2b 100644
--- a/hw/ssd0323.c
+++ b/hw/ssd0323.c
@@ -260,7 +260,7 @@ static void ssd0323_update_display(void *opaque)
}
}
s->redraw = 0;
- dpy_update(s->ds, 0, 0, 128 * MAGNIFY, 64 * MAGNIFY);
+ dpy_gfx_update(s->ds, 0, 0, 128 * MAGNIFY, 64 * MAGNIFY);
}
static void ssd0323_invalidate_display(void * opaque)
diff --git a/hw/tc6393xb.c b/hw/tc6393xb.c
index 31d4f26629..f0320271d4 100644
--- a/hw/tc6393xb.c
+++ b/hw/tc6393xb.c
@@ -454,7 +454,7 @@ static void tc6393xb_draw_graphic(TC6393xbState *s, int full_update)
return;
}
- dpy_update(s->ds, 0, 0, s->scr_width, s->scr_height);
+ dpy_gfx_update(s->ds, 0, 0, s->scr_width, s->scr_height);
}
static void tc6393xb_draw_blank(TC6393xbState *s, int full_update)
@@ -472,7 +472,7 @@ static void tc6393xb_draw_blank(TC6393xbState *s, int full_update)
d += ds_get_linesize(s->ds);
}
- dpy_update(s->ds, 0, 0, s->scr_width, s->scr_height);
+ dpy_gfx_update(s->ds, 0, 0, s->scr_width, s->scr_height);
}
static void tc6393xb_update_display(void *opaque)
diff --git a/hw/tcx.c b/hw/tcx.c
index 7abe865e3f..7aee2a9bd3 100644
--- a/hw/tcx.c
+++ b/hw/tcx.c
@@ -268,8 +268,8 @@ static void tcx_update_display(void *opaque)
} else {
if (y_start >= 0) {
/* flush to display */
- dpy_update(ts->ds, 0, y_start,
- ts->width, y - y_start);
+ dpy_gfx_update(ts->ds, 0, y_start,
+ ts->width, y - y_start);
y_start = -1;
}
d += dd * 4;
@@ -278,8 +278,8 @@ static void tcx_update_display(void *opaque)
}
if (y_start >= 0) {
/* flush to display */
- dpy_update(ts->ds, 0, y_start,
- ts->width, y - y_start);
+ dpy_gfx_update(ts->ds, 0, y_start,
+ ts->width, y - y_start);
}
/* reset modified pages */
if (page_max >= page_min) {
@@ -344,8 +344,8 @@ static void tcx24_update_display(void *opaque)
} else {
if (y_start >= 0) {
/* flush to display */
- dpy_update(ts->ds, 0, y_start,
- ts->width, y - y_start);
+ dpy_gfx_update(ts->ds, 0, y_start,
+ ts->width, y - y_start);
y_start = -1;
}
d += dd * 4;
@@ -356,8 +356,8 @@ static void tcx24_update_display(void *opaque)
}
if (y_start >= 0) {
/* flush to display */
- dpy_update(ts->ds, 0, y_start,
- ts->width, y - y_start);
+ dpy_gfx_update(ts->ds, 0, y_start,
+ ts->width, y - y_start);
}
/* reset modified pages */
if (page_max >= page_min) {
diff --git a/hw/vga.c b/hw/vga.c
index e4220df25e..023134ef68 100644
--- a/hw/vga.c
+++ b/hw/vga.c
@@ -1346,6 +1346,7 @@ static void vga_draw_text(VGACommonState *s, int full_update)
s->last_scr_width = width * cw;
s->last_scr_height = height * cheight;
qemu_console_resize(s->ds, s->last_scr_width, s->last_scr_height);
+ dpy_text_resize(s->ds, width, height);
s->last_depth = 0;
s->last_width = width;
s->last_height = height;
@@ -1359,6 +1360,14 @@ static void vga_draw_text(VGACommonState *s, int full_update)
palette = s->last_palette;
x_incr = cw * ((ds_get_bits_per_pixel(s->ds) + 7) >> 3);
+ if (full_update) {
+ s->full_update_text = 1;
+ }
+ if (s->full_update_gfx) {
+ s->full_update_gfx = 0;
+ full_update |= 1;
+ }
+
cursor_offset = ((s->cr[VGA_CRTC_CURSOR_HI] << 8) |
s->cr[VGA_CRTC_CURSOR_LO]) - s->start_addr;
if (cursor_offset != s->cursor_offset ||
@@ -1456,8 +1465,8 @@ static void vga_draw_text(VGACommonState *s, int full_update)
ch_attr_ptr++;
}
if (cx_max != -1) {
- dpy_update(s->ds, cx_min * cw, cy * cheight,
- (cx_max - cx_min + 1) * cw, cheight);
+ dpy_gfx_update(s->ds, cx_min * cw, cy * cheight,
+ (cx_max - cx_min + 1) * cw, cheight);
}
dest += linesize * cheight;
line1 = line + cheight;
@@ -1688,7 +1697,7 @@ static void vga_draw_graphic(VGACommonState *s, int full_update)
#if defined(HOST_WORDS_BIGENDIAN) != defined(TARGET_WORDS_BIGENDIAN)
s->ds->surface->pf = qemu_different_endianness_pixelformat(depth);
#endif
- dpy_resize(s->ds);
+ dpy_gfx_resize(s->ds);
} else {
qemu_console_resize(s->ds, disp_width, height);
}
@@ -1700,9 +1709,14 @@ static void vga_draw_graphic(VGACommonState *s, int full_update)
s->last_depth = depth;
full_update = 1;
} else if (is_buffer_shared(s->ds->surface) &&
- (full_update || s->ds->surface->data != s->vram_ptr + (s->start_addr * 4))) {
- s->ds->surface->data = s->vram_ptr + (s->start_addr * 4);
- dpy_setdata(s->ds);
+ (full_update || ds_get_data(s->ds) != s->vram_ptr
+ + (s->start_addr * 4))) {
+ qemu_free_displaysurface(s->ds);
+ s->ds->surface = qemu_create_displaysurface_from(disp_width,
+ height, depth,
+ s->line_offset,
+ s->vram_ptr + (s->start_addr * 4));
+ dpy_gfx_setdata(s->ds);
}
s->rgb_to_pixel =
@@ -1807,8 +1821,8 @@ static void vga_draw_graphic(VGACommonState *s, int full_update)
} else {
if (y_start >= 0) {
/* flush to display */
- dpy_update(s->ds, 0, y_start,
- disp_width, y - y_start);
+ dpy_gfx_update(s->ds, 0, y_start,
+ disp_width, y - y_start);
y_start = -1;
}
}
@@ -1828,8 +1842,8 @@ static void vga_draw_graphic(VGACommonState *s, int full_update)
}
if (y_start >= 0) {
/* flush to display */
- dpy_update(s->ds, 0, y_start,
- disp_width, y - y_start);
+ dpy_gfx_update(s->ds, 0, y_start,
+ disp_width, y - y_start);
}
/* reset modified pages */
if (page_max >= page_min) {
@@ -1863,8 +1877,8 @@ static void vga_draw_blank(VGACommonState *s, int full_update)
memset(d, val, w);
d += ds_get_linesize(s->ds);
}
- dpy_update(s->ds, 0, 0,
- s->last_scr_width, s->last_scr_height);
+ dpy_gfx_update(s->ds, 0, 0,
+ s->last_scr_width, s->last_scr_height);
}
#define GMODE_TEXT 0
@@ -2052,9 +2066,9 @@ static void vga_update_text(void *opaque, console_ch_t *chardata)
cw != s->last_cw || cheight != s->last_ch) {
s->last_scr_width = width * cw;
s->last_scr_height = height * cheight;
- s->ds->surface->width = width;
- s->ds->surface->height = height;
- dpy_resize(s->ds);
+ qemu_console_resize(s->ds, s->last_scr_width, s->last_scr_height);
+ dpy_text_resize(s->ds, width, height);
+ s->last_depth = 0;
s->last_width = width;
s->last_height = height;
s->last_ch = cheight;
@@ -2062,6 +2076,14 @@ static void vga_update_text(void *opaque, console_ch_t *chardata)
full_update = 1;
}
+ if (full_update) {
+ s->full_update_gfx = 1;
+ }
+ if (s->full_update_text) {
+ s->full_update_text = 0;
+ full_update |= 1;
+ }
+
/* Update "hardware" cursor */
cursor_offset = ((s->cr[VGA_CRTC_CURSOR_HI] << 8) |
s->cr[VGA_CRTC_CURSOR_LO]) - s->start_addr;
@@ -2070,11 +2092,11 @@ static void vga_update_text(void *opaque, console_ch_t *chardata)
s->cr[VGA_CRTC_CURSOR_END] != s->cursor_end || full_update) {
cursor_visible = !(s->cr[VGA_CRTC_CURSOR_START] & 0x20);
if (cursor_visible && cursor_offset < size && cursor_offset >= 0)
- dpy_cursor(s->ds,
- TEXTMODE_X(cursor_offset),
- TEXTMODE_Y(cursor_offset));
+ dpy_text_cursor(s->ds,
+ TEXTMODE_X(cursor_offset),
+ TEXTMODE_Y(cursor_offset));
else
- dpy_cursor(s->ds, -1, -1);
+ dpy_text_cursor(s->ds, -1, -1);
s->cursor_offset = cursor_offset;
s->cursor_start = s->cr[VGA_CRTC_CURSOR_START];
s->cursor_end = s->cr[VGA_CRTC_CURSOR_END];
@@ -2087,7 +2109,7 @@ static void vga_update_text(void *opaque, console_ch_t *chardata)
for (i = 0; i < size; src ++, dst ++, i ++)
console_write_ch(dst, VMEM2CHTYPE(le32_to_cpu(*src)));
- dpy_update(s->ds, 0, 0, width, height);
+ dpy_text_update(s->ds, 0, 0, width, height);
} else {
c_max = 0;
@@ -2110,7 +2132,7 @@ static void vga_update_text(void *opaque, console_ch_t *chardata)
if (c_min <= c_max) {
i = TEXTMODE_Y(c_min);
- dpy_update(s->ds, 0, i, width, TEXTMODE_Y(c_max) - i + 1);
+ dpy_text_update(s->ds, 0, i, width, TEXTMODE_Y(c_max) - i + 1);
}
}
@@ -2135,10 +2157,8 @@ static void vga_update_text(void *opaque, console_ch_t *chardata)
/* Display a message */
s->last_width = 60;
s->last_height = height = 3;
- dpy_cursor(s->ds, -1, -1);
- s->ds->surface->width = s->last_width;
- s->ds->surface->height = height;
- dpy_resize(s->ds);
+ dpy_text_cursor(s->ds, -1, -1);
+ dpy_text_resize(s->ds, s->last_width, height);
for (dst = chardata, i = 0; i < s->last_width * height; i ++)
console_write_ch(dst ++, ' ');
@@ -2149,7 +2169,7 @@ static void vga_update_text(void *opaque, console_ch_t *chardata)
for (i = 0; i < size; i ++)
console_write_ch(dst ++, 0x00200100 | msg_buffer[i]);
- dpy_update(s->ds, 0, 0, s->last_width, height);
+ dpy_text_update(s->ds, 0, 0, s->last_width, height);
}
static uint64_t vga_mem_read(void *opaque, hwaddr addr,
@@ -2373,13 +2393,12 @@ void vga_init_vbe(VGACommonState *s, MemoryRegion *system_memory)
void ppm_save(const char *filename, struct DisplaySurface *ds, Error **errp)
{
+ int width = pixman_image_get_width(ds->image);
+ int height = pixman_image_get_height(ds->image);
FILE *f;
- uint8_t *d, *d1;
- uint32_t v;
- int y, x;
- uint8_t r, g, b;
+ int y;
int ret;
- char *linebuf, *pbuf;
+ pixman_image_t *linebuf;
trace_ppm_save(filename, ds);
f = fopen(filename, "wb");
@@ -2388,33 +2407,17 @@ void ppm_save(const char *filename, struct DisplaySurface *ds, Error **errp)
strerror(errno));
return;
}
- ret = fprintf(f, "P6\n%d %d\n%d\n", ds->width, ds->height, 255);
+ ret = fprintf(f, "P6\n%d %d\n%d\n", width, height, 255);
if (ret < 0) {
linebuf = NULL;
goto write_err;
}
- linebuf = g_malloc(ds->width * 3);
- d1 = ds->data;
- for(y = 0; y < ds->height; y++) {
- d = d1;
- pbuf = linebuf;
- for(x = 0; x < ds->width; x++) {
- if (ds->pf.bits_per_pixel == 32)
- v = *(uint32_t *)d;
- else
- v = (uint32_t) (*(uint16_t *)d);
- /* Limited to 8 or fewer bits per channel: */
- r = ((v >> ds->pf.rshift) & ds->pf.rmax) << (8 - ds->pf.rbits);
- g = ((v >> ds->pf.gshift) & ds->pf.gmax) << (8 - ds->pf.gbits);
- b = ((v >> ds->pf.bshift) & ds->pf.bmax) << (8 - ds->pf.bbits);
- *pbuf++ = r;
- *pbuf++ = g;
- *pbuf++ = b;
- d += ds->pf.bytes_per_pixel;
- }
- d1 += ds->linesize;
+ linebuf = qemu_pixman_linebuf_create(PIXMAN_BE_r8g8b8, width);
+ for (y = 0; y < height; y++) {
+ qemu_pixman_linebuf_fill(linebuf, ds->image, width, y);
clearerr(f);
- ret = fwrite(linebuf, 1, pbuf - linebuf, f);
+ ret = fwrite(pixman_image_get_data(linebuf), 1,
+ pixman_image_get_stride(linebuf), f);
(void)ret;
if (ferror(f)) {
goto write_err;
@@ -2422,7 +2425,7 @@ void ppm_save(const char *filename, struct DisplaySurface *ds, Error **errp)
}
out:
- g_free(linebuf);
+ qemu_pixman_image_unref(linebuf);
fclose(f);
return;
diff --git a/hw/vga_int.h b/hw/vga_int.h
index 22f1706adf..d4da777e62 100644
--- a/hw/vga_int.h
+++ b/hw/vga_int.h
@@ -154,6 +154,8 @@ typedef struct VGACommonState {
vga_hw_invalidate_ptr invalidate;
vga_hw_screen_dump_ptr screen_dump;
vga_hw_text_update_ptr text_update;
+ bool full_update_text;
+ bool full_update_gfx;
/* hardware mouse cursor support */
uint32_t invalidated_y_table[VGA_MAX_HEIGHT / 32];
void (*cursor_invalidate)(struct VGACommonState *s);
diff --git a/hw/vmware_vga.c b/hw/vmware_vga.c
index badaf7cef4..34532e5c3a 100644
--- a/hw/vmware_vga.c
+++ b/hw/vmware_vga.c
@@ -321,14 +321,14 @@ static inline void vmsvga_update_rect(struct vmsvga_state_s *s,
for (; line > 0; line --, src += bypl, dst += bypl)
memcpy(dst, src, width);
- dpy_update(s->vga.ds, x, y, w, h);
+ dpy_gfx_update(s->vga.ds, x, y, w, h);
}
static inline void vmsvga_update_screen(struct vmsvga_state_s *s)
{
memcpy(ds_get_data(s->vga.ds), s->vga.vram_ptr,
s->bypp * s->width * s->height);
- dpy_update(s->vga.ds, 0, 0, s->width, s->height);
+ dpy_gfx_update(s->vga.ds, 0, 0, s->width, s->height);
}
static inline void vmsvga_update_rect_delayed(struct vmsvga_state_s *s,
@@ -478,8 +478,7 @@ static inline void vmsvga_cursor_define(struct vmsvga_state_s *s,
qc = cursor_builtin_left_ptr();
}
- if (s->vga.ds->cursor_define)
- s->vga.ds->cursor_define(qc);
+ dpy_cursor_define(s->vga.ds, qc);
cursor_put(qc);
}
#endif
@@ -754,9 +753,10 @@ static uint32_t vmsvga_value_read(void *opaque, uint32_t address)
caps |= SVGA_CAP_RECT_FILL;
#endif
#ifdef HW_MOUSE_ACCEL
- if (s->vga.ds->mouse_set)
+ if (dpy_cursor_define_supported(s->vga.ds)) {
caps |= SVGA_CAP_CURSOR | SVGA_CAP_CURSOR_BYPASS_2 |
SVGA_CAP_CURSOR_BYPASS;
+ }
#endif
return caps;
@@ -903,8 +903,9 @@ static void vmsvga_value_write(void *opaque, uint32_t address, uint32_t value)
s->cursor.on |= (value == SVGA_CURSOR_ON_SHOW);
s->cursor.on &= (value != SVGA_CURSOR_ON_HIDE);
#ifdef HW_MOUSE_ACCEL
- if (s->vga.ds->mouse_set && value <= SVGA_CURSOR_ON_SHOW)
- s->vga.ds->mouse_set(s->cursor.x, s->cursor.y, s->cursor.on);
+ if (value <= SVGA_CURSOR_ON_SHOW) {
+ dpy_mouse_set(s->vga.ds, s->cursor.x, s->cursor.y, s->cursor.on);
+ }
#endif
break;
diff --git a/hw/xenfb.c b/hw/xenfb.c
index 338800a4d9..ef24c3315c 100644
--- a/hw/xenfb.c
+++ b/hw/xenfb.c
@@ -717,7 +717,7 @@ static void xenfb_update(void *opaque)
if (xenfb_queue_full(xenfb))
return;
- for (l = xenfb->c.ds->listeners; l != NULL; l = l->next) {
+ QLIST_FOREACH(l, &xenfb->c.ds->listeners, next) {
if (l->idle)
continue;
idle = 0;