From nobody Tue May 14 11:32:03 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; 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=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1601218766; cv=none; d=zohomail.com; s=zohoarc; b=IMEpKR7Wbcg9znB7qf0jfnoGFkGCRalrRhmJk9YsJaZGVMgMGQRDTX02noTVQ/3CSGDmw4cLVDzRRQYSteeNJMGp1/de6gz+sNoXArpvisyb6zG74oQRBtf2SI4F6xB99o+H6ubZUS9AtoEd8V1Xod2qA7s/J9nt5bEt4BWwZmk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1601218766; h=Content-Type: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=8Y86zsB51YRxIrGPaBaJ0OMrK6jcKF47UHG43z60HUs=; b=Dv9zTnIKVG4WmAklVwlPglYgBFwhaZZtUfbfi+7GdbK2G72jtzm04CnttSR0/ZGHgRrk7drsByZrQjY+cam9B/w9CNDRvDNi/MCDsfbJXiZYdEXnk9lLO6jK+4+/dLL1TPaudpVxBmdAAoRU5Apc6mScm9mSqFw7KgoYjcN5uNg= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; 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=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1601218766069438.59738749629696; Sun, 27 Sep 2020 07:59:26 -0700 (PDT) Received: from localhost ([::1]:53078 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kMY96-0006H5-PQ for importer@patchew.org; Sun, 27 Sep 2020 10:59:24 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:49104) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kMY8D-0005Qy-FH for qemu-devel@nongnu.org; Sun, 27 Sep 2020 10:58:29 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:43106) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kMY88-0006TJ-I6 for qemu-devel@nongnu.org; Sun, 27 Sep 2020 10:58:28 -0400 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-195-6AhkGRkrP32wLC_Dwu1F7g-1; Sun, 27 Sep 2020 10:58:19 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 8A6EF1005E5C; Sun, 27 Sep 2020 14:58:18 +0000 (UTC) Received: from localhost (unknown [10.36.110.56]) by smtp.corp.redhat.com (Postfix) with ESMTP id 34ECF60C84; Sun, 27 Sep 2020 14:58:07 +0000 (UTC) Dkim-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1601218702; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=8Y86zsB51YRxIrGPaBaJ0OMrK6jcKF47UHG43z60HUs=; b=C90xHP4qVTT/BJOHnMY/0TxoR97eilhWmkTaZRXWVoqdZq5nqbnQ6Ith3AE9eHBvFGTuAY kHDmskH8dp+++7NdgfoTljjBHamRtdV+iIoo442daGEwfmFXQ0ZN5xjwhJEulCYpeu7ugY +46noDpZ/tLWQvauSJ4nxngHMzqKnjI= X-MC-Unique: 6AhkGRkrP32wLC_Dwu1F7g-1 From: marcandre.lureau@redhat.com To: qemu-devel@nongnu.org Subject: [PATCH v3 1/6] edid: fix physical display size computation Date: Sun, 27 Sep 2020 18:57:46 +0400 Message-Id: <20200927145751.365446-2-marcandre.lureau@redhat.com> In-Reply-To: <20200927145751.365446-1-marcandre.lureau@redhat.com> References: <20200927145751.365446-1-marcandre.lureau@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=marcandre.lureau@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" 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=216.205.24.124; envelope-from=marcandre.lureau@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/09/27 10:58:22 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -36 X-Spam_score: -3.7 X-Spam_bar: --- X-Spam_report: (-3.7 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.576, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H5=-1, RCVD_IN_MSPIKE_WL=-0.01, 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.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: spice-devel@lists.freedesktop.org, Gerd Hoffmann , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , "Michael S. Tsirkin" Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) From: Marc-Andr=C3=A9 Lureau Divide the resolution by the DPI, and multiply to mm. Note the computation done for edid[21/22] is correct (in cm). Signed-off-by: Marc-Andr=C3=A9 Lureau --- hw/display/edid-generate.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/display/edid-generate.c b/hw/display/edid-generate.c index e58472fde5..618c74e1df 100644 --- a/hw/display/edid-generate.c +++ b/hw/display/edid-generate.c @@ -208,8 +208,8 @@ static void edid_desc_timing(uint8_t *desc, uint32_t dpi) { /* physical display size */ - uint32_t xmm =3D xres * dpi / 254; - uint32_t ymm =3D yres * dpi / 254; + uint32_t xmm =3D xres * 254 / 10 / dpi; + uint32_t ymm =3D yres * 254 / 10 / dpi; =20 /* pull some realistic looking timings out of thin air */ uint32_t xfront =3D xres * 25 / 100; --=20 2.26.2 From nobody Tue May 14 11:32:03 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; 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=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1601219122; cv=none; d=zohomail.com; s=zohoarc; b=hJsDqh0ldiw81j667TilY5sOwda6Bv+JB2sDjpynb9SWYrgjKDau3OIdyRRLLQLKNyGHSTmRJFQTT+EkaFy43PTRWuhgk+cHmx/ISuCVL1Oe1eCR6PZelvUsDYewwc8E2cOpNfLHXfMyUdpQisBF0mAxLI/BibYleZeRe9Ii5bs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1601219122; h=Content-Type: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=ybywO2OTt3WzzjRYQOYXGO2tmmQ+4oz5wdGb+9ihuOg=; b=FxtNRB/UvFQzXCr28/sdOzA15xURRRYVcJwio24NyDvz2w+dyA+NGmJnLHnHHnur6YOlMgMTQIPb1nZy99p2k/jMgT+Um/3K8397KsVE18lNM0OOO+f8PfEh3uJ3BXGAQ0ETkWvGu5Tn+kz4gU0RaPRnwNfCn7aM1YsMor/zaEY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; 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=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1601219122110964.8557012599846; Sun, 27 Sep 2020 08:05:22 -0700 (PDT) Received: from localhost ([::1]:35498 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kMYEq-0002oQ-O3 for importer@patchew.org; Sun, 27 Sep 2020 11:05:20 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:49128) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kMY8V-0005d8-MV for qemu-devel@nongnu.org; Sun, 27 Sep 2020 10:58:47 -0400 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:31626) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kMY8T-0006Tu-Lf for qemu-devel@nongnu.org; Sun, 27 Sep 2020 10:58:47 -0400 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-134-KNA4iyfeP2aZtfTmR_I3IA-1; Sun, 27 Sep 2020 10:58:24 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id F3F5E1DDE2; Sun, 27 Sep 2020 14:58:23 +0000 (UTC) Received: from localhost (unknown [10.36.110.56]) by smtp.corp.redhat.com (Postfix) with ESMTP id 841C761982; Sun, 27 Sep 2020 14:58:22 +0000 (UTC) Dkim-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1601218724; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=ybywO2OTt3WzzjRYQOYXGO2tmmQ+4oz5wdGb+9ihuOg=; b=VnKOPx2oFdJn/olQf69aUDfLytAc3oe1ztXaluDlBSSUSsKkYBOqTewzVG7pj1V3DLcZ6G cqfOb8NI5WLINiuFVyOJkK8p1iFcHTJhqwNnfQt0cq2PPS1tjc6z4Zp20Wz+j9+MKdyTwu /OrlXqjxVKKyp4xixvrSdwKXMlR39MA= X-MC-Unique: KNA4iyfeP2aZtfTmR_I3IA-1 From: marcandre.lureau@redhat.com To: qemu-devel@nongnu.org Subject: [PATCH v3 2/6] edid: use physical dimensions if available Date: Sun, 27 Sep 2020 18:57:47 +0400 Message-Id: <20200927145751.365446-3-marcandre.lureau@redhat.com> In-Reply-To: <20200927145751.365446-1-marcandre.lureau@redhat.com> References: <20200927145751.365446-1-marcandre.lureau@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=marcandre.lureau@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" 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=63.128.21.124; envelope-from=marcandre.lureau@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/09/27 10:58:07 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -36 X-Spam_score: -3.7 X-Spam_bar: --- X-Spam_report: (-3.7 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.576, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H5=-1, RCVD_IN_MSPIKE_WL=-0.01, 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.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: spice-devel@lists.freedesktop.org, Gerd Hoffmann , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , "Michael S. Tsirkin" Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) From: Marc-Andr=C3=A9 Lureau Replace dpi with width_mm/height_mm in qemu_edid_info. Use it when set (non-zero) to compute the DPI and generate the EDID. Signed-off-by: Marc-Andr=C3=A9 Lureau --- hw/display/edid-generate.c | 36 +++++++++++++++++++++++++----------- include/hw/display/edid.h | 5 ++++- qemu-edid.c | 11 +++++++++-- 3 files changed, 38 insertions(+), 14 deletions(-) diff --git a/hw/display/edid-generate.c b/hw/display/edid-generate.c index 618c74e1df..1665b7cbb2 100644 --- a/hw/display/edid-generate.c +++ b/hw/display/edid-generate.c @@ -205,12 +205,8 @@ static void edid_desc_dummy(uint8_t *desc) =20 static void edid_desc_timing(uint8_t *desc, uint32_t xres, uint32_t yres, - uint32_t dpi) + uint32_t xmm, uint32_t ymm) { - /* physical display size */ - uint32_t xmm =3D xres * 254 / 10 / dpi; - uint32_t ymm =3D yres * 254 / 10 / dpi; - /* pull some realistic looking timings out of thin air */ uint32_t xfront =3D xres * 25 / 100; uint32_t xsync =3D xres * 3 / 100; @@ -290,12 +286,24 @@ static void edid_colorspace(uint8_t *edid, edid[34] =3D white_y >> 2; } =20 +static uint32_t qemu_edid_dpi_from_mm(uint32_t mm, uint32_t res) +{ + return res * 254 / 10 / mm; +} + +uint32_t qemu_edid_dpi_to_mm(uint32_t dpi, uint32_t res) +{ + return res * 254 / 10 / dpi; +} + void qemu_edid_generate(uint8_t *edid, size_t size, qemu_edid_info *info) { uint32_t desc =3D 54; uint8_t *xtra3 =3D NULL; uint8_t *dta =3D NULL; + uint32_t width_mm, height_mm; + uint32_t dpi =3D 100; /* if no width_mm/height_mm */ =20 /* =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D set defaults =3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D */ =20 @@ -305,15 +313,20 @@ void qemu_edid_generate(uint8_t *edid, size_t size, if (!info->name) { info->name =3D "QEMU Monitor"; } - if (!info->dpi) { - info->dpi =3D 100; - } if (!info->prefx) { info->prefx =3D 1024; } if (!info->prefy) { info->prefy =3D 768; } + if (info->width_mm && info->height_mm) { + width_mm =3D info->width_mm; + height_mm =3D info->height_mm; + dpi =3D qemu_edid_dpi_from_mm(width_mm, info->prefx); + } else { + width_mm =3D qemu_edid_dpi_to_mm(dpi, info->prefx); + height_mm =3D qemu_edid_dpi_to_mm(dpi, info->prefy); + } =20 /* =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D extensions =3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D */ =20 @@ -360,8 +373,8 @@ void qemu_edid_generate(uint8_t *edid, size_t size, edid[20] =3D 0xa5; =20 /* screen size: undefined */ - edid[21] =3D info->prefx * 254 / 100 / info->dpi; - edid[22] =3D info->prefy * 254 / 100 / info->dpi; + edid[21] =3D width_mm / 10; + edid[22] =3D height_mm / 10; =20 /* display gamma: 2.2 */ edid[23] =3D 220 - 100; @@ -387,7 +400,8 @@ void qemu_edid_generate(uint8_t *edid, size_t size, =20 /* =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D descriptor blocks =3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D */ =20 - edid_desc_timing(edid + desc, info->prefx, info->prefy, info->dpi); + edid_desc_timing(edid + desc, info->prefx, info->prefy, + width_mm, height_mm); desc +=3D 18; =20 edid_desc_ranges(edid + desc); diff --git a/include/hw/display/edid.h b/include/hw/display/edid.h index 5b1de57f24..1f8fc9b375 100644 --- a/include/hw/display/edid.h +++ b/include/hw/display/edid.h @@ -5,7 +5,8 @@ typedef struct qemu_edid_info { const char *vendor; /* http://www.uefi.org/pnp_id_list */ const char *name; const char *serial; - uint32_t dpi; + uint16_t width_mm; + uint16_t height_mm; uint32_t prefx; uint32_t prefy; uint32_t maxx; @@ -18,6 +19,8 @@ size_t qemu_edid_size(uint8_t *edid); void qemu_edid_region_io(MemoryRegion *region, Object *owner, uint8_t *edid, size_t size); =20 +uint32_t qemu_edid_dpi_to_mm(uint32_t dpi, uint32_t res); + #define DEFINE_EDID_PROPERTIES(_state, _edid_info) \ DEFINE_PROP_UINT32("xres", _state, _edid_info.prefx, 0), \ DEFINE_PROP_UINT32("yres", _state, _edid_info.prefy, 0), \ diff --git a/qemu-edid.c b/qemu-edid.c index 46eef70498..1db3372b98 100644 --- a/qemu-edid.c +++ b/qemu-edid.c @@ -9,7 +9,10 @@ #include "qemu/cutils.h" #include "hw/display/edid.h" =20 -static qemu_edid_info info; +static qemu_edid_info info =3D (qemu_edid_info) { + .prefx =3D 1024, + .prefy =3D 768, +}; =20 static void usage(FILE *out) { @@ -39,6 +42,7 @@ int main(int argc, char *argv[]) { FILE *outfile =3D NULL; uint8_t blob[256]; + uint32_t dpi =3D 100; int rc; =20 for (;;) { @@ -83,7 +87,7 @@ int main(int argc, char *argv[]) } break; case 'd': - if (qemu_strtoui(optarg, NULL, 10, &info.dpi) < 0) { + if (qemu_strtoui(optarg, NULL, 10, &dpi) < 0) { fprintf(stderr, "not a number: %s\n", optarg); exit(1); } @@ -110,6 +114,9 @@ int main(int argc, char *argv[]) outfile =3D stdout; } =20 + info.width_mm =3D qemu_edid_dpi_to_mm(dpi, info.prefx); + info.height_mm =3D qemu_edid_dpi_to_mm(dpi, info.prefy); + memset(blob, 0, sizeof(blob)); qemu_edid_generate(blob, sizeof(blob), &info); fwrite(blob, sizeof(blob), 1, outfile); --=20 2.26.2 From nobody Tue May 14 11:32:03 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; 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=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1601218906; cv=none; d=zohomail.com; s=zohoarc; b=b+UFZyz4ppl/1VKw5A4pLnwx/N06HgOQ/bNfQUqi/jYkJRQ6LSzajSu8Yavr5R6cLk29v6oHKIC97RDciTuikejpE4A5yO4WvVTA22X3+mz4JFzaBmw/8uMY9vcz4AN9EA81T435FLk4vqR1PgRIiFqSb87n45xEldym6J5du/w= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1601218906; h=Content-Type: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=hNLcghou2JIIFL8nOu0gOdDNzxKgsPO8BGkR410M6LI=; b=YRbrBUIBKrBPfdTEw5RnfH0Ua+D0Sct19AMMqHq1xQGQNgrEHn0P0VrEmNJ4Af0hE7JtXHY4PKYRgeqtKfQM3qdM0myl3REvFDfGNfOdL+mYzK/MIS7hcm1/jSqwVdwDQ+IMkAZfzss1kCuHqKRL7i+17IwS2E/2szchrOE7rU0= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; 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=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1601218906454823.1447744956494; Sun, 27 Sep 2020 08:01:46 -0700 (PDT) Received: from localhost ([::1]:57870 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kMYBN-0008K0-8n for importer@patchew.org; Sun, 27 Sep 2020 11:01:45 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:49124) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kMY8U-0005bY-O1 for qemu-devel@nongnu.org; Sun, 27 Sep 2020 10:58:46 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:20552) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kMY8T-0006Tq-1X for qemu-devel@nongnu.org; Sun, 27 Sep 2020 10:58:46 -0400 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-593-aKgGuxWjPr-Q2HZlDuMVUw-1; Sun, 27 Sep 2020 10:58:41 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id CF8AA807331; Sun, 27 Sep 2020 14:58:40 +0000 (UTC) Received: from localhost (unknown [10.36.110.56]) by smtp.corp.redhat.com (Postfix) with ESMTP id 10DAA5D9CA; Sun, 27 Sep 2020 14:58:27 +0000 (UTC) Dkim-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1601218724; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=hNLcghou2JIIFL8nOu0gOdDNzxKgsPO8BGkR410M6LI=; b=fSES/4Cas0OthixwQM55GDrXZVuBH77IjnnIYUAjcR7vlFIrupJ06DDVW70mNyGQXRTnR6 PcsLvF8cAiU7gbULD94z+GOjNUog5b/orj/xmYA9gjDvZfMTzXIrfooUC+0NOWObnDZEVf 4d0hhYjL5bwzKCXTq3398EJCs0dcs5w= X-MC-Unique: aKgGuxWjPr-Q2HZlDuMVUw-1 From: marcandre.lureau@redhat.com To: qemu-devel@nongnu.org Subject: [PATCH v3 3/6] ui: add getter for UIInfo Date: Sun, 27 Sep 2020 18:57:48 +0400 Message-Id: <20200927145751.365446-4-marcandre.lureau@redhat.com> In-Reply-To: <20200927145751.365446-1-marcandre.lureau@redhat.com> References: <20200927145751.365446-1-marcandre.lureau@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=marcandre.lureau@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" 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=216.205.24.124; envelope-from=marcandre.lureau@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/09/27 10:58:22 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -36 X-Spam_score: -3.7 X-Spam_bar: --- X-Spam_report: (-3.7 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.576, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H5=-1, RCVD_IN_MSPIKE_WL=-0.01, 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.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: spice-devel@lists.freedesktop.org, Gerd Hoffmann , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , "Michael S. Tsirkin" Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) From: Marc-Andr=C3=A9 Lureau The following patch is going to introduce extra fields / details to UIInfo. Add a getter and keep the current values, instead of memset(0) Signed-off-by: Marc-Andr=C3=A9 Lureau --- include/ui/console.h | 1 + ui/console.c | 7 +++++++ ui/spice-display.c | 2 +- 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/include/ui/console.h b/include/ui/console.h index 79e301f946..353d2e49a1 100644 --- a/include/ui/console.h +++ b/include/ui/console.h @@ -264,6 +264,7 @@ void update_displaychangelistener(DisplayChangeListener= *dcl, void unregister_displaychangelistener(DisplayChangeListener *dcl); =20 bool dpy_ui_info_supported(QemuConsole *con); +const QemuUIInfo *dpy_get_ui_info(const QemuConsole *con); int dpy_set_ui_info(QemuConsole *con, QemuUIInfo *info); =20 void dpy_gfx_update(QemuConsole *con, int x, int y, int w, int h); diff --git a/ui/console.c b/ui/console.c index 7592c3c324..54a74c0b16 100644 --- a/ui/console.c +++ b/ui/console.c @@ -1516,6 +1516,13 @@ bool dpy_ui_info_supported(QemuConsole *con) return con->hw_ops->ui_info !=3D NULL; } =20 +const QemuUIInfo *dpy_get_ui_info(const QemuConsole *con) +{ + assert(con !=3D NULL); + + return &con->ui_info; +} + int dpy_set_ui_info(QemuConsole *con, QemuUIInfo *info) { assert(con !=3D NULL); diff --git a/ui/spice-display.c b/ui/spice-display.c index 19632fdf6c..625d9232b9 100644 --- a/ui/spice-display.c +++ b/ui/spice-display.c @@ -672,7 +672,7 @@ static int interface_client_monitors_config(QXLInstance= *sin, return 1; } =20 - memset(&info, 0, sizeof(info)); + info =3D *dpy_get_ui_info(ssd->dcl.con); =20 if (mc->num_of_monitors =3D=3D 1) { /* --=20 2.26.2 From nobody Tue May 14 11:32:03 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; 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=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1601218939; cv=none; d=zohomail.com; s=zohoarc; b=V6aSshQVkrtR/Z95uVf6MouuERreVBLZZApcD+nGR9XaW3r1BndHXpjXwmjoCoVtzgFlxYskNq22vPZKe7a+m0X3g51j999GGotBEMhrqUDCKwaVky3x34dqNLABL1qffjER5oEIwjY167xb60ohCkTICwZyn9XsbQwdd1hbwBA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1601218939; h=Content-Type: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=b0l8qvWRrHwiSkIqmmCGlnK1Woq1I9l3yvB4ZPhG79Y=; b=ehp9sHrzdlOPTEUUDf08bNvmnYcxGm8IFds7FB+r+hfhQfMUY2Tn6o5DTGfcWT7HnY5niSsU5abqzUy50w6oMD8+gc060xasFWWqpOG+8DO5hTq1HjI54nLRHBCwP0PtM5irDhCDAgwyScrUB+ysiWXxQ/vbUAd7/5IYI59qHzM= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; 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=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1601218939213134.56762850414214; Sun, 27 Sep 2020 08:02:19 -0700 (PDT) Received: from localhost ([::1]:59134 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kMYBt-0000X2-W6 for importer@patchew.org; Sun, 27 Sep 2020 11:02:18 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:49152) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kMY8k-000626-E1 for qemu-devel@nongnu.org; Sun, 27 Sep 2020 10:59:02 -0400 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:40913) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kMY8i-0006UI-OT for qemu-devel@nongnu.org; Sun, 27 Sep 2020 10:59:02 -0400 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-300-z30i4VWZN4urGLAgNL5npQ-1; Sun, 27 Sep 2020 10:58:56 -0400 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 2BBA6186841E; Sun, 27 Sep 2020 14:58:55 +0000 (UTC) Received: from localhost (unknown [10.36.110.56]) by smtp.corp.redhat.com (Postfix) with ESMTP id 0332110013C4; Sun, 27 Sep 2020 14:58:44 +0000 (UTC) Dkim-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1601218740; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=b0l8qvWRrHwiSkIqmmCGlnK1Woq1I9l3yvB4ZPhG79Y=; b=P8OUdc5ivEovT5bgi6NFgWBCpdr5vFyXsw475jsnFGKDKTM4JANaR5z2oqhgTsFvBCfZJm PVC5+f9c/V81Vu+Hav2U4a50MjTdFW41avHVzAmrQBbyccRl1GEbMoPfVzyDXXJZn+5k7F fQzPDcLsq3P6ep1zwcqODjqK/lW9Ug8= X-MC-Unique: z30i4VWZN4urGLAgNL5npQ-1 From: marcandre.lureau@redhat.com To: qemu-devel@nongnu.org Subject: [PATCH v3 4/6] spice: remove the single monitor config logic Date: Sun, 27 Sep 2020 18:57:49 +0400 Message-Id: <20200927145751.365446-5-marcandre.lureau@redhat.com> In-Reply-To: <20200927145751.365446-1-marcandre.lureau@redhat.com> References: <20200927145751.365446-1-marcandre.lureau@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=marcandre.lureau@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" 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=63.128.21.124; envelope-from=marcandre.lureau@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/09/27 10:58:07 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -36 X-Spam_score: -3.7 X-Spam_bar: --- X-Spam_report: (-3.7 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.576, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H5=-1, RCVD_IN_MSPIKE_WL=-0.01, 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.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: spice-devel@lists.freedesktop.org, Gerd Hoffmann , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , "Michael S. Tsirkin" Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) From: Marc-Andr=C3=A9 Lureau Introduced in commit 9c956e646178fee8c14ce7dfae5a9d7cb901876c ("spice: prepare for upcoming spice-server change"), the new logic never materialized in the spice server source tree. Let's remove it for now, until it actually changes in Spice. Signed-off-by: Marc-Andr=C3=A9 Lureau --- ui/spice-display.c | 26 ++++---------------------- 1 file changed, 4 insertions(+), 22 deletions(-) diff --git a/ui/spice-display.c b/ui/spice-display.c index 625d9232b9..b304c13149 100644 --- a/ui/spice-display.c +++ b/ui/spice-display.c @@ -674,28 +674,10 @@ static int interface_client_monitors_config(QXLInstan= ce *sin, =20 info =3D *dpy_get_ui_info(ssd->dcl.con); =20 - if (mc->num_of_monitors =3D=3D 1) { - /* - * New spice-server version which filters the list of monitors - * to only include those that belong to our display channel. - * - * single-head configuration (where filtering doesn't matter) - * takes this code path too. - */ - info.width =3D mc->monitors[0].width; - info.height =3D mc->monitors[0].height; - } else { - /* - * Old spice-server which gives us all monitors, so we have to - * figure ourself which entry we need. Array index is the - * channel_id, which is the qemu console index, see - * qemu_spice_add_display_interface(). - */ - head =3D qemu_console_get_index(ssd->dcl.con); - if (mc->num_of_monitors > head) { - info.width =3D mc->monitors[head].width; - info.height =3D mc->monitors[head].height; - } + head =3D qemu_console_get_index(ssd->dcl.con); + if (mc->num_of_monitors > head) { + info.width =3D mc->monitors[head].width; + info.height =3D mc->monitors[head].height; } =20 trace_qemu_spice_ui_info(ssd->qxl.id, info.width, info.height); --=20 2.26.2 From nobody Tue May 14 11:32:03 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; 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=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1601218861; cv=none; d=zohomail.com; s=zohoarc; b=MlFzwnV1dkQUvWTIA1xCievlFzQ9OOtWGfdh13+Ih9IN1mwKNJbbyxVjDynEDDbVVL20c4aEoW5aNR84kBnjMkYy9XDlxCZYf7WXgy9NGaxcUBmRuAOgZMFRJ/4B0WYC63R1yVzDDSbW/6n/N7OtIGz8PqdzRaOGKEs4+jkw8MI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1601218861; h=Content-Type: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=EWT3eeP8M1S4mF5jrWBk/Kh6soLRKqtXBG4/bKeL4bg=; b=L22aj0KevJY4bGiV+qhB0OyCkRkeU78Mp9bPxd66kICvR48hSx6NDwE3ilQcTS504fxADiP6PrVYJp/jAu2AGvyNICqlqfCoKVbUlBs+UHquRBQEynj0gd0uije2SU2NzC43vT8pN1A2PMkgu2hi19lsloXwFjYCbwQVtTiVYNY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; 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=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1601218861442361.471477273177; Sun, 27 Sep 2020 08:01:01 -0700 (PDT) Received: from localhost ([::1]:56590 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kMYAc-0007fG-TG for importer@patchew.org; Sun, 27 Sep 2020 11:00:59 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:49190) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kMY8y-0006QE-57 for qemu-devel@nongnu.org; Sun, 27 Sep 2020 10:59:16 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:36410) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kMY8w-0006Vq-IQ for qemu-devel@nongnu.org; Sun, 27 Sep 2020 10:59:15 -0400 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-381-Xq8ATs5mOLmMQx8X147b_g-1; Sun, 27 Sep 2020 10:59:09 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 92680807322; Sun, 27 Sep 2020 14:59:08 +0000 (UTC) Received: from localhost (unknown [10.36.110.56]) by smtp.corp.redhat.com (Postfix) with ESMTP id 5BBFA78801; Sun, 27 Sep 2020 14:58:59 +0000 (UTC) Dkim-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1601218754; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=EWT3eeP8M1S4mF5jrWBk/Kh6soLRKqtXBG4/bKeL4bg=; b=Fq9ofA/1hqmSVobVHEsNCzIAVkfkjEh4laXgIwbbh5KFKEFSQemDW4rRlrI3aPnsSAycWl cMliBkXCqWwO2sv1XSCI2hRDFQbuQVBqVPwYtw3MFF/O8WkpWn5GC6oUJtm86ERXvgFwwJ cppe6Bdv7Q5WRQ8XXVUTFljrS+bSfXE= X-MC-Unique: Xq8ATs5mOLmMQx8X147b_g-1 From: marcandre.lureau@redhat.com To: qemu-devel@nongnu.org Subject: [PATCH v3 5/6] spice: get monitors physical dimension Date: Sun, 27 Sep 2020 18:57:50 +0400 Message-Id: <20200927145751.365446-6-marcandre.lureau@redhat.com> In-Reply-To: <20200927145751.365446-1-marcandre.lureau@redhat.com> References: <20200927145751.365446-1-marcandre.lureau@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=marcandre.lureau@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" 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=216.205.24.124; envelope-from=marcandre.lureau@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/09/27 10:58:22 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -36 X-Spam_score: -3.7 X-Spam_bar: --- X-Spam_report: (-3.7 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.576, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H5=-1, RCVD_IN_MSPIKE_WL=-0.01, 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.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: spice-devel@lists.freedesktop.org, Gerd Hoffmann , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , "Michael S. Tsirkin" Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) From: Marc-Andr=C3=A9 Lureau With upcoming Spice server version 0.14.4, the monitor configuration can contain additional fields for the monitor physical dimensions. Signed-off-by: Marc-Andr=C3=A9 Lureau --- include/ui/console.h | 3 +++ ui/spice-display.c | 7 +++++++ 2 files changed, 10 insertions(+) diff --git a/include/ui/console.h b/include/ui/console.h index 353d2e49a1..e7303d8b98 100644 --- a/include/ui/console.h +++ b/include/ui/console.h @@ -119,6 +119,9 @@ typedef struct DisplaySurface { } DisplaySurface; =20 typedef struct QemuUIInfo { + /* physical dimension */ + uint16_t width_mm; + uint16_t height_mm; /* geometry */ int xoff; int yoff; diff --git a/ui/spice-display.c b/ui/spice-display.c index b304c13149..0178d5766d 100644 --- a/ui/spice-display.c +++ b/ui/spice-display.c @@ -678,6 +678,13 @@ static int interface_client_monitors_config(QXLInstanc= e *sin, if (mc->num_of_monitors > head) { info.width =3D mc->monitors[head].width; info.height =3D mc->monitors[head].height; +#if SPICE_SERVER_VERSION >=3D 0x000e04 /* release 0.14.4 */ + if (mc->flags & VD_AGENT_CONFIG_MONITORS_FLAG_PHYSICAL_SIZE) { + VDAgentMonitorMM *mm =3D (void *)&mc->monitors[mc->num_of_moni= tors]; + info.width_mm =3D mm[head].width; + info.height_mm =3D mm[head].height; + } +#endif } =20 trace_qemu_spice_ui_info(ssd->qxl.id, info.width, info.height); --=20 2.26.2 From nobody Tue May 14 11:32:03 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; 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=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1601219225; cv=none; d=zohomail.com; s=zohoarc; b=lVbGX4L0mP1qsOOyPUVgRvrZckz+r+zyem6p4cnDQ/xRNRcFukkpRVIfGubzoThVzUkJxbkFKs4Ba4GzrpiBveyqAHzBvoCYfQevzxIwSRDu2HRNDhUewo+jLWRAweYBIclN6Dqw8Qd3gUBSS96i5ghp9GyrUYSsKawrkqwSUPQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1601219225; h=Content-Type: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=PQD54WdAZS3iIKMslHPFTacgZs+8lfyKf4zASmwmDHo=; b=CBv0PJMp8t7LPcJIbeY17PgzXmORF32hPuqcriMPCx4nB+bpq92pbGNSspJWRTSbSMXSMb07PginlAm5LX1ym0QJo23HMonNTtJpIHQvCAiw6G6T/MCdSN9R3kGcV1Vd9QkRxQkRd4gCw3lteDAZAkV2Grrtakl3quKlg56rbW0= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; 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=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1601219225163825.061027774729; Sun, 27 Sep 2020 08:07:05 -0700 (PDT) Received: from localhost ([::1]:40062 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kMYGV-0005IO-Td for importer@patchew.org; Sun, 27 Sep 2020 11:07:03 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:49244) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kMY9A-0006om-27 for qemu-devel@nongnu.org; Sun, 27 Sep 2020 10:59:28 -0400 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:43929) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kMY98-0006Wl-ED for qemu-devel@nongnu.org; Sun, 27 Sep 2020 10:59:27 -0400 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-260-k-zpFqQAOJ6mkyBYcCIQXg-1; Sun, 27 Sep 2020 10:59:23 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 809231DDEB; Sun, 27 Sep 2020 14:59:22 +0000 (UTC) Received: from localhost (unknown [10.36.110.56]) by smtp.corp.redhat.com (Postfix) with ESMTP id F0C145D9CA; Sun, 27 Sep 2020 14:59:12 +0000 (UTC) Dkim-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1601218765; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=PQD54WdAZS3iIKMslHPFTacgZs+8lfyKf4zASmwmDHo=; b=MdSBh/hMZbSBMDBo1ciStgazvwK4+iR7SNxBINoK2d4TzNRkLWntJsCbL3WJxM5mhp22zr koMX8YC/YhxHSU1WEFFzaFjaJkztNnAKo+FWSyjS+fOjhBg2hsTN3uJxd1W7Suoi+3W89T FKl0QucFIGWa2TqVCgYSR/ulCCbjJLU= X-MC-Unique: k-zpFqQAOJ6mkyBYcCIQXg-1 From: marcandre.lureau@redhat.com To: qemu-devel@nongnu.org Subject: [PATCH v3 6/6] virtio-gpu: set physical dimensions for EDID Date: Sun, 27 Sep 2020 18:57:51 +0400 Message-Id: <20200927145751.365446-7-marcandre.lureau@redhat.com> In-Reply-To: <20200927145751.365446-1-marcandre.lureau@redhat.com> References: <20200927145751.365446-1-marcandre.lureau@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=marcandre.lureau@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" 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=63.128.21.124; envelope-from=marcandre.lureau@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/09/27 10:58:07 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -36 X-Spam_score: -3.7 X-Spam_bar: --- X-Spam_report: (-3.7 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.576, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H5=-1, RCVD_IN_MSPIKE_WL=-0.01, 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.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: spice-devel@lists.freedesktop.org, Gerd Hoffmann , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , "Michael S. Tsirkin" Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) From: Marc-Andr=C3=A9 Lureau Signed-off-by: Marc-Andr=C3=A9 Lureau --- hw/display/virtio-gpu-base.c | 2 ++ hw/display/virtio-gpu.c | 2 ++ include/hw/virtio/virtio-gpu.h | 1 + 3 files changed, 5 insertions(+) diff --git a/hw/display/virtio-gpu-base.c b/hw/display/virtio-gpu-base.c index aeb8723542..40ccd00f94 100644 --- a/hw/display/virtio-gpu-base.c +++ b/hw/display/virtio-gpu-base.c @@ -82,6 +82,8 @@ static int virtio_gpu_ui_info(void *opaque, uint32_t idx,= QemuUIInfo *info) g->req_state[idx].y =3D info->yoff; g->req_state[idx].width =3D info->width; g->req_state[idx].height =3D info->height; + g->req_state[idx].width_mm =3D info->width_mm; + g->req_state[idx].height_mm =3D info->height_mm; =20 if (info->width && info->height) { g->enabled_output_bitmask |=3D (1 << idx); diff --git a/hw/display/virtio-gpu.c b/hw/display/virtio-gpu.c index 90be4e3ed7..f3b71fa9c7 100644 --- a/hw/display/virtio-gpu.c +++ b/hw/display/virtio-gpu.c @@ -212,6 +212,8 @@ virtio_gpu_generate_edid(VirtIOGPU *g, int scanout, { VirtIOGPUBase *b =3D VIRTIO_GPU_BASE(g); qemu_edid_info info =3D { + .width_mm =3D b->req_state[scanout].width_mm, + .height_mm =3D b->req_state[scanout].height_mm, .prefx =3D b->req_state[scanout].width, .prefy =3D b->req_state[scanout].height, }; diff --git a/include/hw/virtio/virtio-gpu.h b/include/hw/virtio/virtio-gpu.h index 455e0a7433..1aed7275c8 100644 --- a/include/hw/virtio/virtio-gpu.h +++ b/include/hw/virtio/virtio-gpu.h @@ -62,6 +62,7 @@ struct virtio_gpu_scanout { }; =20 struct virtio_gpu_requested_state { + uint16_t width_mm, height_mm; uint32_t width, height; int x, y; }; --=20 2.26.2