vga shared memory
PATCH 1/1 vga shared memory
Hi all,
now that the qemu WMVi patch is applied we can take full advantage of it sharing the video buffer between the vga driver and the qemu vnc server.
This saves a lot of memcpy.
It's worth mentioning again that when the guest colour depth is 24 bit we cannot share the buffer because 24 bpp is not supported by the vnc protocol, so we still have to do the translation 24 bpp -> 32 bpp.
Signed-off-by Stefano Stabellini <[email protected]>
tools/ioemu/hw/vga.c +12 -10
@@ -1135,8 +1135,6 @@ static void vga_draw_text(VGAState *s, i } depth = s->get_bpp (s); -if (depth ==24 ) - depth =32 ;if (s->ds->dpy_colourdepth !=NULL && s->ds->depth != depth) s->ds->dpy_colourdepth (s->ds, depth); if (width != s->last_width || height != s->last_height ||
@@ -1557,10 +1555,10 @@ static void vga_draw_graphic(VGAState *s vga_draw_line = vga_draw_line_table[v *NB_DEPTHS +get_depth_index (s->ds)]; depth = s->get_bpp (s); -if (depth ==24 ) - depth =32 ; -if (s->ds->dpy_colourdepth !=NULL && s->ds->depth != depth) - s->ds->dpy_colourdepth (s->ds, depth); +if (s->ds->dpy_colourdepth !=NULL && s->ds->depth != depth) { +if (depth !=24 || s->ds->depth !=32 ) + s->ds->dpy_colourdepth (s->ds, depth); + }if (disp_width != s->last_width || height != s->last_height) {dpy_resize (s->ds, disp_width, height);
@@ -1570,7 +1568,9 @@ static void vga_draw_graphic(VGAState *s s->last_height = height; full_update =1 ; } -if (s->cursor_invalidate) +if (s->ds->shared_buf && s->ds->data != s->vram_ptr + (s->start_addr *4 )) + s->ds->data = s->vram_ptr + (s->start_addr *4 ); +if (!s->ds->shared_buf && s->cursor_invalidate) s->cursor_invalidate (s); line_offset = s->line_offset;
@@ -1621,9 +1621,11 @@ static void vga_draw_graphic(VGAState *s page_min = page0;if (page_max ==0 || page1 > page_max) page_max = page1; -vga_draw_line (s, d, s->vram_ptr + addr, width); -if (s->cursor_draw_line) - s->cursor_draw_line (s, d, y); +if (!s->ds->shared_buf) { +vga_draw_line (s, d, s->vram_ptr + addr, width); +if (s->cursor_draw_line) + s->cursor_draw_line (s, d, y); + } }else {if (y_start >=0 ) {/* flush to display */
tools/ioemu/vl.h +1 -0
@@ -935,6 +935,7 @@ struct DisplayState {void *opaque;int switchbpp; +int shared_buf;void (*dpy_update)(struct DisplayState *s,int x,int y,int w,int h);void (*dpy_resize)(struct DisplayState *s,int w,int h);
tools/ioemu/vnc.c +33 -11
82 lines not on this page · raw message
_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel