From nobody Sat Apr 27 14:43:07 2024 Delivered-To: importer2@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1678292842; cv=none; d=zohomail.com; s=zohoarc; b=V4jC1AiIasYcQz9AcMcH87+VrkQ30vbgg9Pq7lS2hzasj3FKTGQKg5PF3ou/5nmo/l6DJkWBTzdjWFO7chLzuD4oNz8vNbL9YfxAYGi80Vpcq12fmSclzwa0d6X0tpUQNeQuD6Adt/s9Sevhij04UGpcFnnov/wMlDgJvzSv3Qw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1678292842; 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=qOIi1CH/JsTPf5cx35mmqx9zyHjauzvaEw+3nDwjxSg=; b=QXW40EcsD5x/aCP+bNMwT4E9MGbCNr/Q+aIyCbUOHynsQg2cZgDGsuj7cR8xDL+8e7QImLpaIuRDw3qxYByEw1cFfL6iZAykiN64zOvW6TfBWL6YG7iF12OR5TEdOl7p0xI8DSuVC/zvrdZMc0lgYN49gz3u3v8Ii6dIWXiR13c= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1678292842431447.09007340559333; Wed, 8 Mar 2023 08:27:22 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pZwcN-0004ko-Ad; Wed, 08 Mar 2023 11:26:19 -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 1pZwcL-0004kY-BG for qemu-devel@nongnu.org; Wed, 08 Mar 2023 11:26:17 -0500 Received: from mail-qt1-x835.google.com ([2607:f8b0:4864:20::835]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pZwcJ-0002re-BY for qemu-devel@nongnu.org; Wed, 08 Mar 2023 11:26:17 -0500 Received: by mail-qt1-x835.google.com with SMTP id d7so18590551qtr.12 for ; Wed, 08 Mar 2023 08:26:14 -0800 (PST) Received: from D100-Linux.hq.igel.co.jp (135-23-249-188.cpe.pppoe.ca. [135.23.249.188]) by smtp.gmail.com with ESMTPSA id z207-20020a3765d8000000b0074236d3a149sm11780577qkb.92.2023.03.08.08.26.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 Mar 2023 08:26:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=igel-co-jp.20210112.gappssmtp.com; s=20210112; t=1678292774; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=qOIi1CH/JsTPf5cx35mmqx9zyHjauzvaEw+3nDwjxSg=; b=gXxMy47nrS3UgvF0XxaEhAQ/AbImxgnz1rVbdfn5aKGXlb8+NvYVJ87MEriqMoWfps JgFzTMsrCMFgJBlKVGLvj0+SwbJ39IVZrP4Vr8PVeQG3lDtvt/d0XlGKbx9b4hoi7bgI CrlDXiyAWOzE+ACoPylL0OxlNcCpA+opVD+IuWXlCx0yhp1W9dwMRkMqA7rcpouQtFX/ zCpDpdAdgfpNSnOinu18ryd8zTNRhmjJozaxlviGXKJbqgLl+QPTA2cm+55za1aBJkdt DQVZBHnP4IRc2Dn/0Lk+5vbLejC0WIygtFfth8w0jj2UYLQJvJIgcOj6HK+9SoIOUxn0 fbPg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678292774; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=qOIi1CH/JsTPf5cx35mmqx9zyHjauzvaEw+3nDwjxSg=; b=Ry0KpWeWk81AMiDFscy2pcI/Yd9Yz5DxBmqCbMUrO8EqlSSYtwEiJJ4sOV2YapTmbK z8VgVUWwZPml7IVA0uiBO4rcLR5Lok0TW9ZGqV4qF4uvUk7saJU4tM/NtHaKM+xJ5KqK z1YfGSgOHV28IdMsM8irr9GedY/dlIt4jQctuS3KbyMX4cJssEkGA41H4LqUFB8cRVVd tPALAcilUxzsDjy8ZwuCjq2eNF7qr/FlP3q5CbVHF09Fxpfy7e4n9k5xxlGoVVF8VEUb 8IR8iBGgd0eNzxKU5Sv1X272IMDGH2lG6t60+sGoOH9VWMBafuDjb3GG1vUZRKCJYdm3 Hgvg== X-Gm-Message-State: AO0yUKWUdbg8JhG06Gb3VIgLDwlBdUIegN3s7illUQ012wqgJPuLM66q LRXpZZEaN0HK3MVRDFoCUwpKrOOL/Ymh553PH2k= X-Google-Smtp-Source: AK7set/RDazIsalmjRqDkW2SZej1tcXyr7GgLKL7kCXDJ7ygeMiL5IPYyfqI/a+hRWGDhFKjTJWZQQ== X-Received: by 2002:ac8:5d91:0:b0:3bf:c221:5871 with SMTP id d17-20020ac85d91000000b003bfc2215871mr33742623qtx.54.1678292773922; Wed, 08 Mar 2023 08:26:13 -0800 (PST) From: Damian Hobson-Garcia To: qemu-devel@nongnu.org Cc: kraxel@redhat.com, mst@redhat.com, marcandre.lureau@redhat.com, Damian Hobson-Garcia Subject: [RFC PATCH 1/2] gtk: Make sure widget is realized before updating Date: Wed, 8 Mar 2023 11:25:47 -0500 Message-Id: <20230308162548.1766359-2-dhobsong@igel.co.jp> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230308162548.1766359-1-dhobsong@igel.co.jp> References: <20230308162548.1766359-1-dhobsong@igel.co.jp> 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+importer2=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::835; envelope-from=dhobsong@igel.co.jp; helo=mail-qt1-x835.google.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, 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+importer2=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer2=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @igel-co-jp.20210112.gappssmtp.com) X-ZM-MESSAGEID: 1678292843146100001 Content-Type: text/plain; charset="utf-8" Check that a widget has a window before trying to update its contents. Reviewed-by: Marc-Andr=C3=A9 Lureau --- ui/gtk.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ui/gtk.c b/ui/gtk.c index fd82e9b1ca..e4e0980323 100644 --- a/ui/gtk.c +++ b/ui/gtk.c @@ -340,6 +340,10 @@ static void gd_update_full_redraw(VirtualConsole *vc) { GtkWidget *area =3D vc->gfx.drawing_area; int ww, wh; + + if (!gtk_widget_get_realized(area)) { + return; + } ww =3D gdk_window_get_width(gtk_widget_get_window(area)); wh =3D gdk_window_get_height(gtk_widget_get_window(area)); #if defined(CONFIG_OPENGL) --=20 2.25.1 From nobody Sat Apr 27 14:43:07 2024 Delivered-To: importer2@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1678292833; cv=none; d=zohomail.com; s=zohoarc; b=PpnbDpup8f55vnET/cro/KOrCJ5eGPexho11XV5kvAfPtA9n0mgDbzooT9Q/GAJCc6SBCrIL2wg/mxROeqmcb/28DeO1vb0E24yPexXVcLoQlYgMfZWXuFE88NB4oUmZtzTI10hkN0k4xX4g4Jpf0uci7cIyD7HfE5cFbiOfWI0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1678292833; 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=78ydkmMTOCm6kt7Hh6Cy+HDr2L1dCmuECV9DyZPvslc=; b=c6DP9iRzF19WV4Tk4mag+04TjStrZibr9W2eRYploQMLGViJyTJTC38pslMlwuvYsfFPkdZAZkFb9utCo3C1lD4f69J0Qf/FLe2pFKrU4JceS0XKDE4gnVuiodCm3J4n5qxornigZpncfR0if+SF9XbCbejWzkR6NpPINPTmkPk= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1678292833789669.4912942234006; Wed, 8 Mar 2023 08:27:13 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pZwcP-0004lu-Vt; Wed, 08 Mar 2023 11:26:22 -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 1pZwcM-0004kp-QE for qemu-devel@nongnu.org; Wed, 08 Mar 2023 11:26:18 -0500 Received: from mail-qv1-xf29.google.com ([2607:f8b0:4864:20::f29]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pZwcK-0002sD-Nb for qemu-devel@nongnu.org; Wed, 08 Mar 2023 11:26:18 -0500 Received: by mail-qv1-xf29.google.com with SMTP id nv15so11422278qvb.7 for ; Wed, 08 Mar 2023 08:26:16 -0800 (PST) Received: from D100-Linux.hq.igel.co.jp (135-23-249-188.cpe.pppoe.ca. [135.23.249.188]) by smtp.gmail.com with ESMTPSA id z207-20020a3765d8000000b0074236d3a149sm11780577qkb.92.2023.03.08.08.26.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 Mar 2023 08:26:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=igel-co-jp.20210112.gappssmtp.com; s=20210112; t=1678292775; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=78ydkmMTOCm6kt7Hh6Cy+HDr2L1dCmuECV9DyZPvslc=; b=ugNUyLQr/NzcfuyXkHdJMw3oFETCvI9AKGQIroh+ObG9reLorDndCmnpzsV+TJvVR7 iNhMNeaNwRFmTT5l9ObKEOAS6Cn8DTKjRuaXo8We40iGMWA7RUkXP2MHqzS9ZgmLqch9 roy2nTRlauwBsF6v4aOU0eV6RDn90DOEzAjRQxeFI5reAHYDwpB/MMmuT/CSRtM5YyYM wCMoeSI5qj3i1qENAAdj5taMxkrsnm3CYjDXC6ARctWBBUtZJw16RUn+q9sBwJKIZ03B 4TRY/ct1uAtaTSWLaSgAMt+4Y3lg+jeSOExW2mimH1angyRmUAFU1E8IR9qlEF+aj6Hb zmMg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678292775; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=78ydkmMTOCm6kt7Hh6Cy+HDr2L1dCmuECV9DyZPvslc=; b=F8Cn7sbSmvt6auAemaTE1Okff/bZwOMioleolRDzOuinGV8ZDDgTeZdpOzs+ZY3eFr KXhG9ZMtWf15ugPykjohdkyv6v6TB0kXXUOkejoI9DuhNvvAo61xLAv0KQXKsJ3QrooQ EZ+xosPOkQb8rB7PPLKg8iW0YQeNIJ/Qy7m1AiT/784sbixxDTdje9CJBR2zNe1q8Ig4 mhHlsfZ3QLPVKezJL747M+uo8iDgyUX3OCUnYozUMSx2E51YC2TEAMllH1Q/j1+nPud9 rpqkhg190E7eAf3ueTGQYbIfeaqXwQQg5s2R3OM4dqFu5LjEdiEVW6X7NGr49kgqsgTn LsXQ== X-Gm-Message-State: AO0yUKX9FmctoE3jxXEwSJiawRfOdlmBXpl5uz5qCewdmgy6uJElaMkz YA+n062nBLaPlLDqN+9+2Zzju/z64eekus8JylI= X-Google-Smtp-Source: AK7set/eM20N+3lsiw5ORghxhZluIuBXsTlAjQ06CUgaOOrxq9n9fynR6ZL3cSeqL3Y15i1inVOIhg== X-Received: by 2002:a05:6214:5089:b0:56e:b5a1:b52d with SMTP id kk9-20020a056214508900b0056eb5a1b52dmr30405070qvb.28.1678292775610; Wed, 08 Mar 2023 08:26:15 -0800 (PST) From: Damian Hobson-Garcia To: qemu-devel@nongnu.org Cc: kraxel@redhat.com, mst@redhat.com, marcandre.lureau@redhat.com, Damian Hobson-Garcia Subject: [RFC PATCH 2/2] virtio-gpu: Add an option to connect all outputs on startup Date: Wed, 8 Mar 2023 11:25:48 -0500 Message-Id: <20230308162548.1766359-3-dhobsong@igel.co.jp> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230308162548.1766359-1-dhobsong@igel.co.jp> References: <20230308162548.1766359-1-dhobsong@igel.co.jp> 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+importer2=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::f29; envelope-from=dhobsong@igel.co.jp; helo=mail-qv1-xf29.google.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, 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+importer2=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer2=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @igel-co-jp.20210112.gappssmtp.com) X-ZM-MESSAGEID: 1678292835125100005 Content-Type: text/plain; charset="utf-8" When multiple outputs are enabled using the "max_outputs" attribute, only the first connector appears as "Connected" in the guest DRM device. Additional connectors must be enabled from the host side UI frontend before they are usable by the guest. However, multiple outputs can still be of use on a headless configuration, if for example, the display will only be used for taking periodic screenshots in the guest or integration into a CI pipeline, etc. Add an option to start all of the outputs in the "Connected" state, so that they are immediately available to the guest. Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1107 Signed-off-by: Damian Hobson-Garcia --- hw/display/virtio-gpu-base.c | 12 +++++++++--- include/hw/virtio/virtio-gpu.h | 7 ++++++- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/hw/display/virtio-gpu-base.c b/hw/display/virtio-gpu-base.c index a29f191aa8..885184e302 100644 --- a/hw/display/virtio-gpu-base.c +++ b/hw/display/virtio-gpu-base.c @@ -158,6 +158,7 @@ virtio_gpu_base_device_realize(DeviceState *qdev, { VirtIODevice *vdev =3D VIRTIO_DEVICE(qdev); VirtIOGPUBase *g =3D VIRTIO_GPU_BASE(qdev); + int connected =3D 1; int i; =20 if (g->conf.max_outputs > VIRTIO_GPU_MAX_SCANOUTS) { @@ -186,10 +187,15 @@ virtio_gpu_base_device_realize(DeviceState *qdev, virtio_add_queue(vdev, 16, cursor_cb); } =20 - g->enabled_output_bitmask =3D 1; + if (virtio_gpu_connect_all_outputs(g->conf)) + connected =3D g->conf.max_outputs; =20 - g->req_state[0].width =3D g->conf.xres; - g->req_state[0].height =3D g->conf.yres; + g->enabled_output_bitmask =3D (1 << connected) - 1; + + for (i =3D 0; i < connected; i++) { + g->req_state[i].width =3D g->conf.xres; + g->req_state[i].height =3D g->conf.yres; + } =20 g->hw_ops =3D &virtio_gpu_ops; for (i =3D 0; i < g->conf.max_outputs; i++) { diff --git a/include/hw/virtio/virtio-gpu.h b/include/hw/virtio/virtio-gpu.h index 2e28507efe..54b3eba632 100644 --- a/include/hw/virtio/virtio-gpu.h +++ b/include/hw/virtio/virtio-gpu.h @@ -90,6 +90,7 @@ enum virtio_gpu_base_conf_flags { VIRTIO_GPU_FLAG_EDID_ENABLED, VIRTIO_GPU_FLAG_DMABUF_ENABLED, VIRTIO_GPU_FLAG_BLOB_ENABLED, + VIRTIO_GPU_FLAG_CONNECT_ALL_OUTPUTS, }; =20 #define virtio_gpu_virgl_enabled(_cfg) \ @@ -102,6 +103,8 @@ enum virtio_gpu_base_conf_flags { (_cfg.flags & (1 << VIRTIO_GPU_FLAG_DMABUF_ENABLED)) #define virtio_gpu_blob_enabled(_cfg) \ (_cfg.flags & (1 << VIRTIO_GPU_FLAG_BLOB_ENABLED)) +#define virtio_gpu_connect_all_outputs(_cfg) \ + (_cfg.flags & (1 << VIRTIO_GPU_FLAG_CONNECT_ALL_OUTPUTS)) =20 struct virtio_gpu_base_conf { uint32_t max_outputs; @@ -148,7 +151,9 @@ struct VirtIOGPUBaseClass { DEFINE_PROP_BIT("edid", _state, _conf.flags, \ VIRTIO_GPU_FLAG_EDID_ENABLED, true), \ DEFINE_PROP_UINT32("xres", _state, _conf.xres, 1280), \ - DEFINE_PROP_UINT32("yres", _state, _conf.yres, 800) + DEFINE_PROP_UINT32("yres", _state, _conf.yres, 800), \ + DEFINE_PROP_BIT("connect_outputs", _state, _conf.flags, \ + VIRTIO_GPU_FLAG_CONNECT_ALL_OUTPUTS, false) =20 typedef struct VGPUDMABuf { QemuDmaBuf buf; --=20 2.25.1