From nobody Sun May 12 05:14:22 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass header.i=@intel.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1668736729; cv=none; d=zohomail.com; s=zohoarc; b=evL3nMSdM+lqBTEgygHiG8+mkLxjB51qto9O5UWAc1wgJh6LuhUrNDoh8i5JFDXtXU2LJkFwOTdDRhbofmzDEdd6ZPa4g+WBJhdHMJytZ1jqKQFhkk3QKSXWso7kV71yaLG9h/dhuvVGcr6Sk13922tfknjzPAV+FZ7OFZPJGl0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1668736729; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=8Y4m2QPsscaTTxaMC50XEKOtLrXffNKorNfrNmFfNgI=; b=al7GxKkk34pW5C4AybM86ptLp+z64zYuXUWM471Rpo3fzctiNLC63jz/bWdKhFezpJqc9PwuXPba0ynI2AjN/p1PctL/ITpp8C274PIujL/LkUw6BLlD97/MR+kC+JldetFr2bkOUrtp8ijLd00pcdDDV0TOcSZouH5tGZtU1zs= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass header.i=@intel.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1668736729478862.9155770724407; Thu, 17 Nov 2022 17:58:49 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ovqdp-0004ux-3i; Thu, 17 Nov 2022 20:58:05 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ovqdo-0004ul-Av for qemu-devel@nongnu.org; Thu, 17 Nov 2022 20:58:04 -0500 Received: from mga04.intel.com ([192.55.52.120]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ovqdm-0007Pp-Hl for qemu-devel@nongnu.org; Thu, 17 Nov 2022 20:58:04 -0500 Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 Nov 2022 17:57:53 -0800 Received: from vkasired-desk2.fm.intel.com ([10.105.128.127]) by fmsmga004-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 Nov 2022 17:57:53 -0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1668736682; x=1700272682; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=wKZwwxUFsMcgW4jsvA1xTPC8gB4fMwiqSqG6joE4a4U=; b=gsvy21+JmUG6Cv2s1x2oniAM9j8v+E9FFmgksLEWd07Fht2tcxojm3Kw BfzrGMU9DyMofl7WsPQTuD/S7v8I0nmRdR0kUZD2GdB0n7QBPCuQcx16p nvDQD1jPCeabFUtIrVPQO0KwYA4C+h9yTdU3eaTfPbGT+ZXek1MN21ZBj pr7whwsW/rCveL468zOdoJQ+yxf5qU8ka2iLebvhq3+HLOic5J8OCGwXs QOqX2HwLReOr7mM/0SrXwqPP7cmRbEKHF9tN10tOiPDftcOKVio2FF88Z swksojGzKAwkw+0Q/AuGavD4DNlqHODUux8DY9LNrkjc2MN4iezbyCDgE A==; X-IronPort-AV: E=McAfee;i="6500,9779,10534"; a="311731510" X-IronPort-AV: E=Sophos;i="5.96,172,1665471600"; d="scan'208";a="311731510" X-IronPort-AV: E=McAfee;i="6500,9779,10534"; a="708859342" X-IronPort-AV: E=Sophos;i="5.96,172,1665471600"; d="scan'208";a="708859342" From: Vivek Kasireddy To: qemu-devel@nongnu.org Cc: Vivek Kasireddy , Dongwon Kim , Gerd Hoffmann Subject: [PATCH v1 1/2] virtio-gpu: Provide position info (x, y) to the Guest Date: Thu, 17 Nov 2022 17:37:22 -0800 Message-Id: <20221118013723.182424-2-vivek.kasireddy@intel.com> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20221118013723.182424-1-vivek.kasireddy@intel.com> References: <20221118013723.182424-1-vivek.kasireddy@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=192.55.52.120; envelope-from=vivek.kasireddy@intel.com; helo=mga04.intel.com X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @intel.com) X-ZM-MESSAGEID: 1668736730757100003 Content-Type: text/plain; charset="utf-8" While filling out the display info such as width, height to be provided to the Guest, make sure that the position information (x, y) is also included. This position info corresponds with the x and y fields mentioned in the spec: https://github.com/oasis-tcs/virtio-spec/blob/master/virtio-gpu.tex#L343 Cc: Dongwon Kim Cc: Gerd Hoffmann Signed-off-by: Vivek Kasireddy Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- hw/display/virtio-gpu-base.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/hw/display/virtio-gpu-base.c b/hw/display/virtio-gpu-base.c index a29f191aa8..3b6b480131 100644 --- a/hw/display/virtio-gpu-base.c +++ b/hw/display/virtio-gpu-base.c @@ -47,6 +47,8 @@ virtio_gpu_base_fill_display_info(VirtIOGPUBase *g, dpy_info->pmodes[i].enabled =3D 1; dpy_info->pmodes[i].r.width =3D cpu_to_le32(g->req_state[i].wi= dth); dpy_info->pmodes[i].r.height =3D cpu_to_le32(g->req_state[i].h= eight); + dpy_info->pmodes[i].r.x =3D cpu_to_le32(g->req_state[i].x); + dpy_info->pmodes[i].r.y =3D cpu_to_le32(g->req_state[i].y); } } } --=20 2.37.2 From nobody Sun May 12 05:14:22 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass header.i=@intel.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1668736730; cv=none; d=zohomail.com; s=zohoarc; b=W2Hyx62EarOrhy0EEOV4MEGvdgBa7wpOAXd9+Ju1omQW4x/zpNgLzyI/B5cudgwdyjbMpc2X9Bru0xWz0evbzOdaEcmRbkrlwOC/Q0lgkVus1pz11kDL40vD8qt5EzyWzz0EtUiX/d8vz3LYTQWrCdO8rPPqQ/7sc5xvfGvdtrs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1668736730; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=ZhBh0OknWCZBvVnLUX7rMDvNB7YSP8US6xYKcWgHwHA=; b=QFqOkSmMuvwYx1TWM1l+nn4mHrjq1xU8ao0D5ftdWQicqoqZgIe2fpSNPp7Uf/y6xm4kpQlnGNIwk3keTRkH6K1iftBS7XWLfWWQSl+CdGmK0cttWP43N47uSIfuYUmkVpYIUAjvMktxkX26LmKBq3iz2LAhEKdzYE8YrpmPswg= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass header.i=@intel.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1668736730340605.45261201119; Thu, 17 Nov 2022 17:58:50 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ovqdo-0004ut-S9; Thu, 17 Nov 2022 20:58:04 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ovqdn-0004tz-6T for qemu-devel@nongnu.org; Thu, 17 Nov 2022 20:58:03 -0500 Received: from mga04.intel.com ([192.55.52.120]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ovqdl-0007Pe-Lv for qemu-devel@nongnu.org; Thu, 17 Nov 2022 20:58:02 -0500 Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 Nov 2022 17:57:53 -0800 Received: from vkasired-desk2.fm.intel.com ([10.105.128.127]) by fmsmga004-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 Nov 2022 17:57:53 -0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1668736681; x=1700272681; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=oXuv0bqBvJSqJlVZ86xJBVuX2v+9XZpsn6wJkK1oPEc=; b=NNM95T/ZVz1bamykNdbRERW1rXRuGAlta/53nC8lke36vgeBdI6wTKFJ 4WWcK21sjjSKG+jRod9EQRC/bFgIWvTPWCwOlX/COXrOn9CXUUOXUlbpK fRLXymFRskcST+kWs+r4soJ/vWxo+MeCB+MB0Zv1aIoW4WUhZigPqQCI8 iFTkKvfngHHHeYl4JsCqYK5M48gSbK1SHHBtWlPIXsJcRnevdGUp5a7zE KqEAnAxxwU71Skk/L+AKrDkco7fV4g/gZ5rSTdx+ybqnkkgOOJmcmKf2d kdVA2tOwV089/KN24UWl0zbQIYKuCgFNKtDfvqImUSDQN+xx8LkjmdPiy A==; X-IronPort-AV: E=McAfee;i="6500,9779,10534"; a="311731511" X-IronPort-AV: E=Sophos;i="5.96,172,1665471600"; d="scan'208";a="311731511" X-IronPort-AV: E=McAfee;i="6500,9779,10534"; a="708859345" X-IronPort-AV: E=Sophos;i="5.96,172,1665471600"; d="scan'208";a="708859345" From: Vivek Kasireddy To: qemu-devel@nongnu.org Cc: Vivek Kasireddy , Dongwon Kim , Gerd Hoffmann Subject: [PATCH v1 2/2] ui/gtk: Include the position info while setting the ui info Date: Thu, 17 Nov 2022 17:37:23 -0800 Message-Id: <20221118013723.182424-3-vivek.kasireddy@intel.com> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20221118013723.182424-1-vivek.kasireddy@intel.com> References: <20221118013723.182424-1-vivek.kasireddy@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=192.55.52.120; envelope-from=vivek.kasireddy@intel.com; helo=mga04.intel.com X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @intel.com) X-ZM-MESSAGEID: 1668736732596100010 Content-Type: text/plain; charset="utf-8" In situtations where the Guest uses multiple displays/outputs, this position info is useful for aligning the Guest's outputs with that of the Host's. Cc: Dongwon Kim Cc: Gerd Hoffmann Signed-off-by: Vivek Kasireddy --- ui/gtk.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/ui/gtk.c b/ui/gtk.c index 92daaa6a6e..12b3bc6481 100644 --- a/ui/gtk.c +++ b/ui/gtk.c @@ -714,12 +714,31 @@ static gboolean gd_window_close(GtkWidget *widget, Gd= kEvent *event, return TRUE; } =20 +static void gd_set_ui_window_position(VirtualConsole *vc, QemuUIInfo *info) +{ + GdkDisplay *dpy =3D gtk_widget_get_display(vc->gfx.drawing_area); + GdkWindow *window; + GdkMonitor *monitor; + GdkRectangle geometry; + + if (!gtk_widget_get_realized(vc->gfx.drawing_area)) { + return; + } + + window =3D gtk_widget_get_window(vc->gfx.drawing_area); + monitor =3D gdk_display_get_monitor_at_window(dpy, window); + gdk_monitor_get_geometry(monitor, &geometry); + info->xoff =3D geometry.x; + info->yoff =3D geometry.y; +} + static void gd_set_ui_refresh_rate(VirtualConsole *vc, int refresh_rate) { QemuUIInfo info; =20 info =3D *dpy_get_ui_info(vc->gfx.dcl.con); info.refresh_rate =3D refresh_rate; + gd_set_ui_window_position(vc, &info); dpy_set_ui_info(vc->gfx.dcl.con, &info, true); } =20 @@ -730,6 +749,7 @@ static void gd_set_ui_size(VirtualConsole *vc, gint wid= th, gint height) info =3D *dpy_get_ui_info(vc->gfx.dcl.con); info.width =3D width; info.height =3D height; + gd_set_ui_window_position(vc, &info); dpy_set_ui_info(vc->gfx.dcl.con, &info, true); } =20 --=20 2.37.2