From: Gerd Hoffmann <kraxel@redhat.com>
To: qemu-devel@nongnu.org
Cc: Gerd Hoffmann <kraxel@redhat.com>, Anthony Liguori <aliguori@amazon.com>
Subject: [Qemu-devel] [PATCH 8/8] ui/sdl2: Support shared surface for more pixman formats
Date: Fri, 9 Jan 2015 10:28:37 +0100 [thread overview]
Message-ID: <1420795717-28966-9-git-send-email-kraxel@redhat.com> (raw)
In-Reply-To: <1420795717-28966-1-git-send-email-kraxel@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
include/ui/sdl2.h | 2 ++
ui/sdl2-2d.c | 13 +++++++++++++
ui/sdl2.c | 13 +++++++------
3 files changed, 22 insertions(+), 6 deletions(-)
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 */
diff --git a/ui/sdl2-2d.c b/ui/sdl2-2d.c
index 9264817..f907c21 100644
--- a/ui/sdl2-2d.c
+++ b/ui/sdl2-2d.c
@@ -120,3 +120,16 @@ void sdl2_2d_redraw(struct sdl2_console *scon)
surface_width(scon->surface),
surface_height(scon->surface));
}
+
+bool sdl2_2d_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);
+}
diff --git a/ui/sdl2.c b/ui/sdl2.c
index 1ae2781..60e3c3b 100644
--- a/ui/sdl2.c
+++ b/ui/sdl2.c
@@ -668,12 +668,13 @@ static void sdl_cleanup(void)
}
static const DisplayChangeListenerOps dcl_2d_ops = {
- .dpy_name = "sdl2-2d",
- .dpy_gfx_update = sdl2_2d_update,
- .dpy_gfx_switch = sdl2_2d_switch,
- .dpy_refresh = sdl2_2d_refresh,
- .dpy_mouse_set = sdl_mouse_warp,
- .dpy_cursor_define = sdl_mouse_define,
+ .dpy_name = "sdl2-2d",
+ .dpy_gfx_update = sdl2_2d_update,
+ .dpy_gfx_switch = sdl2_2d_switch,
+ .dpy_gfx_check_format = sdl2_2d_check_format,
+ .dpy_refresh = sdl2_2d_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
prev parent reply other threads:[~2015-01-09 9:29 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-01-09 9:28 [Qemu-devel] [PATCH 0/8] ui/console: add format negotiation for shared surfaces Gerd Hoffmann
2015-01-09 9:28 ` [Qemu-devel] [PATCH 1/8] ui: Make qemu_default_pixman_format() return 0 on unsupported formats Gerd Hoffmann
2015-01-09 9:28 ` [Qemu-devel] [PATCH 2/8] ui: Add dpy_gfx_check_format() to check backend shared surface support Gerd Hoffmann
2015-01-09 9:28 ` [Qemu-devel] [PATCH 3/8] ui/pixman: add qemu_pixman_check_format Gerd Hoffmann
2015-01-09 9:28 ` [Qemu-devel] [PATCH 4/8] ui/vnc: Support shared surface for most pixman formats Gerd Hoffmann
2015-01-09 9:28 ` [Qemu-devel] [PATCH 5/8] ui/spice: " Gerd Hoffmann
2015-01-09 9:28 ` [Qemu-devel] [PATCH 6/8] ui/gtk: " Gerd Hoffmann
2015-01-09 9:28 ` [Qemu-devel] [PATCH 7/8] ui/sdl: Support shared surface for more " Gerd Hoffmann
2015-01-09 9:28 ` Gerd Hoffmann [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1420795717-28966-9-git-send-email-kraxel@redhat.com \
--to=kraxel@redhat.com \
--cc=aliguori@amazon.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).