From: Tina Zhang <tina.zhang@intel.com>
To: alex.williamson@redhat.com, kraxel@redhat.com,
zhenyuw@linux.intel.com, hang.yuan@intel.com
Cc: Tina Zhang <tina.zhang@intel.com>,
intel-gvt-dev@lists.freedesktop.org, qemu-devel@nongnu.org
Subject: [Qemu-devel] [PATCH 1/2] console: introduce dpy_gfx_switch_surface
Date: Mon, 23 Apr 2018 16:14:37 +0800 [thread overview]
Message-ID: <1524471278-22546-2-git-send-email-tina.zhang@intel.com> (raw)
In-Reply-To: <1524471278-22546-1-git-send-email-tina.zhang@intel.com>
dpy_gfx_switch_surface is used to ask each valid DisplayChangeListener
of a QemuConsole to switch to another DisplaySurface.
Signed-off-by: Tina Zhang <tina.zhang@intel.com>
---
include/ui/console.h | 2 ++
ui/console.c | 16 ++++++++++++++++
2 files changed, 18 insertions(+)
diff --git a/include/ui/console.h b/include/ui/console.h
index 37a8d68..434033d 100644
--- a/include/ui/console.h
+++ b/include/ui/console.h
@@ -293,6 +293,8 @@ int dpy_set_ui_info(QemuConsole *con, QemuUIInfo *info);
void dpy_gfx_update(QemuConsole *con, int x, int y, int w, int h);
void dpy_gfx_replace_surface(QemuConsole *con,
DisplaySurface *surface);
+void dpy_gfx_switch_surface(QemuConsole *con,
+ DisplaySurface *surface);
void dpy_text_cursor(QemuConsole *con, int x, int y);
void dpy_text_update(QemuConsole *con, int x, int y, int w, int h);
void dpy_text_resize(QemuConsole *con, int w, int h);
diff --git a/ui/console.c b/ui/console.c
index 3fb2f4e..2deb38b 100644
--- a/ui/console.c
+++ b/ui/console.c
@@ -1595,6 +1595,22 @@ void dpy_gfx_replace_surface(QemuConsole *con,
qemu_free_displaysurface(old_surface);
}
+void dpy_gfx_switch_surface(QemuConsole *con,
+ DisplaySurface *surface)
+{
+ DisplayState *s = con->ds;
+ DisplayChangeListener *dcl;
+
+ QLIST_FOREACH(dcl, &s->listeners, next) {
+ if (con != (dcl->con ? dcl->con : active_console)) {
+ continue;
+ }
+ if (dcl->ops->dpy_gfx_switch) {
+ dcl->ops->dpy_gfx_switch(dcl, surface);
+ }
+ }
+}
+
bool dpy_gfx_check_format(QemuConsole *con,
pixman_format_code_t format)
{
--
2.7.4
next prev parent reply other threads:[~2018-04-23 8:20 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-04-23 8:14 [Qemu-devel] [PATCH 0/2] Add vfio display reset handling Tina Zhang
2018-04-23 8:14 ` Tina Zhang [this message]
2018-04-23 13:04 ` [Qemu-devel] [PATCH 1/2] console: introduce dpy_gfx_switch_surface Gerd Hoffmann
2018-04-23 8:14 ` [Qemu-devel] [PATCH 2/2] ui: introduce vfio_display_reset Tina Zhang
2018-04-23 13:12 ` Gerd Hoffmann
2018-04-24 6:54 ` Zhang, Tina
2018-04-24 8:16 ` Gerd Hoffmann
2018-04-25 7:23 ` Zhang, Tina
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=1524471278-22546-2-git-send-email-tina.zhang@intel.com \
--to=tina.zhang@intel.com \
--cc=alex.williamson@redhat.com \
--cc=hang.yuan@intel.com \
--cc=intel-gvt-dev@lists.freedesktop.org \
--cc=kraxel@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=zhenyuw@linux.intel.com \
/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).