vga shared buffer
PATCH 1/1 vga shared buffer
This patch implements a shared buffer interface for the vga guest framebuffer.
Signed-off-by Stefano Stabellini <[email protected]>
---
console.c +15 -7
@@ -1334,12 +1334,20 @@ CharDriverState *text_console_init(DisplayState *ds, const char *p)void qemu_console_resize (QEMUConsole *console,int width,int height) { -if (console->g_width != width || console->g_height != height - || !console->ds->data) { - console->g_width = width; - console->g_height = height; -if (active_console == console) { -dpy_resize (console->ds, width, height); - } + console->g_width = width; + console->g_height = height; +if (active_console == console) { +dpy_resize (console->ds, width, height); + } +} + +void qemu_console_resize_shared (QEMUConsole *console,int width,int height, +int depth,int linesize,void *pixels) +{ + console->g_width = width; + console->g_height = height; +if (active_console == console) { +dpy_resize_shared (console->ds, width, height, depth, linesize, pixels); } } +
console.h +10 -0
@@ -84,9 +84,12 @@ struct DisplayState {struct QEMUTimer *gui_timer;uint64_t gui_timer_interval;int idle;/* there is nothing to update (window invisible), set by vnc/sdl */ +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); +void (*dpy_resize_shared)(struct DisplayState *s,int w,int h,int depth,int linesize,void *pixels); +void (*dpy_setdata)(DisplayState *s,void *pixels);void (*dpy_refresh)(struct DisplayState *s);void (*dpy_copy)(struct DisplayState *s,int src_x,int src_y,int dst_x,int dst_y,int w,int h);
@@ -108,6 +111,11 @@ static inline void dpy_resize(DisplayState *s, int w, int h) s->dpy_resize (s, w, h); } +static inline void dpy_resize_shared (DisplayState *s,int w,int h,int depth,int linesize,void *pixels) +{ + s->dpy_resize_shared (s, w, h, depth, linesize, pixels); +} +static inline void dpy_cursor (DisplayState *s,int x,int y) {if (s->dpy_text_cursor)
@@ -140,6 +148,8 @@ CharDriverState *text_console_init(DisplayState *ds, const char *p);void console_select (unsigned int index);void console_color_init (DisplayState *ds);void qemu_console_resize (QEMUConsole *console,int width,int height); +void qemu_console_resize_shared (QEMUConsole *console,int width,int height, +int depth,int linesize,void *pixels);/* sdl.c */ void sdl_display_init (DisplayState *ds,int full_screen,int no_frame);
hw/vga.c +60 -28
181 lines not on this page · raw message
hw/vga_int.h +2 -0
@@ -130,9 +130,11 @@uint32_t line_compare; \uint32_t start_addr; \uint32_t plane_updated; \ +uint32_t last_line_offset; \uint8_t last_cw, last_ch; \uint32_t last_width, last_height;/* in chars or pixels */ \uint32_t last_scr_width, last_scr_height;/* in pixels */ \ +uint32_t last_depth;/* in bits */ \uint8_t cursor_start, cursor_end; \uint32_t cursor_offset; \ unsigned int (*rgb_to_pixel)(unsigned int r, \