[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 7/8] ui/sdl: Support shared surface for more pixman
From: |
Gerd Hoffmann |
Subject: |
[Qemu-devel] [PATCH 7/8] ui/sdl: Support shared surface for more pixman formats |
Date: |
Fri, 9 Jan 2015 10:28:36 +0100 |
From: Benjamin Herrenschmidt <address@hidden>
At least all the ones I've tested. We make the assumption that
SDL is going to be better at conversion than we are.
Signed-off-by: Benjamin Herrenschmidt <address@hidden>
[ kraxel: minor format tweaks ]
Signed-off-by: Gerd Hoffmann <address@hidden>
---
ui/sdl.c | 26 ++++++++++++++++++++------
1 file changed, 20 insertions(+), 6 deletions(-)
diff --git a/ui/sdl.c b/ui/sdl.c
index 3e9d810..138ca73 100644
--- a/ui/sdl.c
+++ b/ui/sdl.c
@@ -151,6 +151,19 @@ static void sdl_switch(DisplayChangeListener *dcl,
pf.bmask, pf.amask);
}
+static bool sdl_check_format(DisplayChangeListener *dcl,
+ pixman_format_code_t format)
+{
+ /*
+ * We let SDL convert for us a few more formats than,
+ * the native ones. Thes are the ones I have tested.
+ */
+ return (format == PIXMAN_x8r8g8b8 ||
+ format == PIXMAN_b8g8r8x8 ||
+ format == PIXMAN_x1r5g5b5 ||
+ format == PIXMAN_r5g6b5);
+}
+
/* generic keyboard conversion */
#include "sdl_keysym.h"
@@ -865,12 +878,13 @@ static void sdl_cleanup(void)
}
static const DisplayChangeListenerOps dcl_ops = {
- .dpy_name = "sdl",
- .dpy_gfx_update = sdl_update,
- .dpy_gfx_switch = sdl_switch,
- .dpy_refresh = sdl_refresh,
- .dpy_mouse_set = sdl_mouse_warp,
- .dpy_cursor_define = sdl_mouse_define,
+ .dpy_name = "sdl",
+ .dpy_gfx_update = sdl_update,
+ .dpy_gfx_switch = sdl_switch,
+ .dpy_gfx_check_format = sdl_check_format,
+ .dpy_refresh = sdl_refresh,
+ .dpy_mouse_set = sdl_mouse_warp,
+ .dpy_cursor_define = sdl_mouse_define,
};
void sdl_display_init(DisplayState *ds, int full_screen, int no_frame)
--
1.8.3.1
- [Qemu-devel] [PATCH 0/8] ui/console: add format negotiation for shared surfaces, Gerd Hoffmann, 2015/01/09
- [Qemu-devel] [PATCH 1/8] ui: Make qemu_default_pixman_format() return 0 on unsupported formats, Gerd Hoffmann, 2015/01/09
- [Qemu-devel] [PATCH 5/8] ui/spice: Support shared surface for most pixman formats, Gerd Hoffmann, 2015/01/09
- [Qemu-devel] [PATCH 4/8] ui/vnc: Support shared surface for most pixman formats, Gerd Hoffmann, 2015/01/09
- [Qemu-devel] [PATCH 2/8] ui: Add dpy_gfx_check_format() to check backend shared surface support, Gerd Hoffmann, 2015/01/09
- [Qemu-devel] [PATCH 3/8] ui/pixman: add qemu_pixman_check_format, Gerd Hoffmann, 2015/01/09
- [Qemu-devel] [PATCH 8/8] ui/sdl2: Support shared surface for more pixman formats, Gerd Hoffmann, 2015/01/09
- [Qemu-devel] [PATCH 7/8] ui/sdl: Support shared surface for more pixman formats,
Gerd Hoffmann <=
- [Qemu-devel] [PATCH 6/8] ui/gtk: Support shared surface for most pixman formats, Gerd Hoffmann, 2015/01/09