From 49743df399ca1029f4e22b52e9238d8e25c26bb2 Mon Sep 17 00:00:00 2001 From: Benjamin Herrenschmidt Date: Mon, 7 Jul 2014 16:39:05 +1000 Subject: ui: Add dpy_gfx_check_format() to check backend shared surface support This allows VGA to decide whether to use a shared surface based on whether the UI backend supports the format or not. Backends that don't provide the new callback fallback to native 32 bpp which is equivalent to what was supported before. Signed-off-by: Benjamin Herrenschmidt [ kraxel: fix console check, allow only 32 bpp as fallback ] Signed-off-by: Gerd Hoffmann --- include/ui/console.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'include') diff --git a/include/ui/console.h b/include/ui/console.h index 22ef8ca..047b6da 100644 --- a/include/ui/console.h +++ b/include/ui/console.h @@ -161,6 +161,8 @@ typedef struct DisplayChangeListenerOps { void (*dpy_gfx_copy)(DisplayChangeListener *dcl, int src_x, int src_y, int dst_x, int dst_y, int w, int h); + bool (*dpy_gfx_check_format)(DisplayChangeListener *dcl, + pixman_format_code_t format); void (*dpy_text_cursor)(DisplayChangeListener *dcl, int x, int y); @@ -235,6 +237,8 @@ void dpy_gfx_update_dirty(QemuConsole *con, MemoryRegion *address_space, uint64_t base, bool invalidate); +bool dpy_gfx_check_format(QemuConsole *con, + pixman_format_code_t format); static inline int surface_stride(DisplaySurface *s) { -- cgit v1.1 From 8cd996f493d4fc10844bd13bde4b9c9c5e38cc3a Mon Sep 17 00:00:00 2001 From: Gerd Hoffmann Date: Fri, 9 Jan 2015 08:49:20 +0100 Subject: ui/pixman: add qemu_pixman_check_format Convinience check_format function for UIs using pixman. Signed-off-by: Gerd Hoffmann --- include/ui/qemu-pixman.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'include') diff --git a/include/ui/qemu-pixman.h b/include/ui/qemu-pixman.h index 381969d..3dee576 100644 --- a/include/ui/qemu-pixman.h +++ b/include/ui/qemu-pixman.h @@ -37,6 +37,8 @@ PixelFormat qemu_pixelformat_from_pixman(pixman_format_code_t format); pixman_format_code_t qemu_default_pixman_format(int bpp, bool native_endian); int qemu_pixman_get_type(int rshift, int gshift, int bshift); pixman_format_code_t qemu_pixman_get_format(PixelFormat *pf); +bool qemu_pixman_check_format(DisplayChangeListener *dcl, + pixman_format_code_t format); pixman_image_t *qemu_pixman_linebuf_create(pixman_format_code_t format, int width); -- cgit v1.1 From 877417d9ae6846bea4744b198131a5fe5117d7a5 Mon Sep 17 00:00:00 2001 From: Gerd Hoffmann Date: Fri, 9 Jan 2015 09:27:09 +0100 Subject: ui/sdl2: Support shared surface for more pixman formats Signed-off-by: Gerd Hoffmann --- include/ui/sdl2.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'include') diff --git a/include/ui/sdl2.h b/include/ui/sdl2.h index f56c596..51fff2e 100644 --- a/include/ui/sdl2.h +++ b/include/ui/sdl2.h @@ -28,5 +28,7 @@ void sdl2_2d_switch(DisplayChangeListener *dcl, DisplaySurface *new_surface); void sdl2_2d_refresh(DisplayChangeListener *dcl); void sdl2_2d_redraw(struct sdl2_console *scon); +bool sdl2_2d_check_format(DisplayChangeListener *dcl, + pixman_format_code_t format); #endif /* SDL2_H */ -- cgit v1.1