From patchwork Mon Apr 23 08:14:37 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Zhang, Tina" X-Patchwork-Id: 10356383 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id D9C5B601BE for ; Mon, 23 Apr 2018 08:23:04 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CC76527D29 for ; Mon, 23 Apr 2018 08:23:04 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id BF95527E63; Mon, 23 Apr 2018 08:23:04 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id A676027D29 for ; Mon, 23 Apr 2018 08:23:02 +0000 (UTC) Received: from localhost ([::1]:53840 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fAWkX-0008Oq-Bz for patchwork-qemu-devel@patchwork.kernel.org; Mon, 23 Apr 2018 04:23:01 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49053) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fAWhm-0006xR-Rp for qemu-devel@nongnu.org; Mon, 23 Apr 2018 04:20:17 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fAWhj-0001On-N6 for qemu-devel@nongnu.org; Mon, 23 Apr 2018 04:20:10 -0400 Received: from mga01.intel.com ([192.55.52.88]:41385) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fAWhj-0001Ng-9J for qemu-devel@nongnu.org; Mon, 23 Apr 2018 04:20:07 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga007.jf.intel.com ([10.7.209.58]) by fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 23 Apr 2018 01:20:05 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.49,317,1520924400"; d="scan'208";a="35411515" Received: from tinazhang-linux-1.bj.intel.com ([10.238.158.97]) by orsmga007.jf.intel.com with ESMTP; 23 Apr 2018 01:20:00 -0700 From: Tina Zhang To: alex.williamson@redhat.com, kraxel@redhat.com, zhenyuw@linux.intel.com, hang.yuan@intel.com Date: Mon, 23 Apr 2018 16:14:37 +0800 Message-Id: <1524471278-22546-2-git-send-email-tina.zhang@intel.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1524471278-22546-1-git-send-email-tina.zhang@intel.com> References: <1524471278-22546-1-git-send-email-tina.zhang@intel.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 192.55.52.88 Subject: [Qemu-devel] [PATCH 1/2] console: introduce dpy_gfx_switch_surface X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: intel-gvt-dev@lists.freedesktop.org, qemu-devel@nongnu.org, Tina Zhang Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP dpy_gfx_switch_surface is used to ask each valid DisplayChangeListener of a QemuConsole to switch to another DisplaySurface. Signed-off-by: Tina Zhang --- 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) {