From nobody Wed May 15 05:42:55 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=1601042048; cv=none; d=zohomail.com; s=zohoarc; b=bfHdGSxdNjiuRBGBokuN1VtPF7501kZcx/Wr/79KiyyM6e7cSUZgD49TpQ8mXtmsSGnskh4h5i3MiKDVNx2wtG8XxkCDvOp/xYbm67yDYQecI5HBT4rGqjr9BSKEMyqjd5hBc16PQTBS5pEr2ZHlmtbWDdoMmJWKg0x5DZWfbeA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1601042048; 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=TKejh47feleoqqxfxOyU0sTsYkaaWrmSYa1M1wx+5Hat0H0YAuZAGsG0w6qlgt0jHS8dvHZk3aLeSpvn4yiDtxiaVSxp8uJ49LQJtSOIZtAZZ0cj2YqEXLUVCzSFylQBrAA0aw2oynQBm6rlT8ZyrTucK2+3apXIdM/GWKeKBtY= 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 1601042048828218.829190417601; Fri, 25 Sep 2020 06:54:08 -0700 (PDT) Received: from localhost ([::1]:50724 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kLoAp-0008VE-Ez for importer@patchew.org; Fri, 25 Sep 2020 09:54:07 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:35780) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kLo8U-0005yF-To for qemu-devel@nongnu.org; Fri, 25 Sep 2020 09:51:43 -0400 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:56948) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kLo8S-00017v-Tn for qemu-devel@nongnu.org; Fri, 25 Sep 2020 09:51:42 -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-592--Y6R1eraMc22fZGv1yEz7Q-1; Fri, 25 Sep 2020 09:51:38 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 34A42802B78; Fri, 25 Sep 2020 13:51:37 +0000 (UTC) Received: from localhost (unknown [10.36.110.56]) by smtp.corp.redhat.com (Postfix) with ESMTP id 533B87368F; Fri, 25 Sep 2020 13:51:19 +0000 (UTC) Dkim-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1601041900; 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=i+m1Y7JmTTb06n22NjUm7COyJRc+6f/TLB4IcYEhZfkxJCXT/yrGhx4i8GFixaiMqu1ot0 9LTEm+fiW/cA1UQQKTjRX6g72EWR9Fze8JZbnI+ZvlFFmT2JRzXecL5Y26iI4G7AEWRZdL cC0lcNT/eVmOw9BumJzdYmCMOtGfauI= X-MC-Unique: -Y6R1eraMc22fZGv1yEz7Q-1 From: marcandre.lureau@redhat.com To: qemu-devel@nongnu.org Subject: [PATCH v2 1/6] edid: fix physical display size computation Date: Fri, 25 Sep 2020 17:50:52 +0400 Message-Id: <20200925135057.291556-2-marcandre.lureau@redhat.com> In-Reply-To: <20200925135057.291556-1-marcandre.lureau@redhat.com> References: <20200925135057.291556-1-marcandre.lureau@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 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/25 01:07:33 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -32 X-Spam_score: -3.3 X-Spam_bar: --- X-Spam_report: (-3.3 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-1.199, 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=0.001, RCVD_IN_MSPIKE_WL=0.001, 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 Wed May 15 05:42:55 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=1601042184; cv=none; d=zohomail.com; s=zohoarc; b=n8Sw65PmZEnwRJ5pkHlEBGE1a0vLbvnD3dqERGJ4KhDoHLxzW7jX/EdWu0H2tiL5RPavTtd7y2JbJuiVFWSdt5/7vQL7R9kf3vJjE6W/Eg+NfSkY6gWi68SAxzPA6/jS3OeEElQtiee7Z2Y7WXZfwsqIqL/GFkJw4/dRa75n1Yw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1601042184; 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=SZCwGZc9wexktcmU+z38tSL1LY43PGwKaqb7DA9E+cb1WEP+Gmud1OPOX1s8P23DaypUWLrUv8bj8R88yRiIhNxuVyqnZwfPyCyVOVboZD+QDhMDgDBhlQGVoxBI5ls9rDKPVLitaY9LLuts7JNMrPI7xie72Q5V4vs2tsaU9UU= 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 1601042184570385.74746269712546; Fri, 25 Sep 2020 06:56:24 -0700 (PDT) Received: from localhost ([::1]:55314 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kLoD1-00025Q-7B for importer@patchew.org; Fri, 25 Sep 2020 09:56:23 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:36006) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kLo9N-0007GE-Bo for qemu-devel@nongnu.org; Fri, 25 Sep 2020 09:52:39 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:44700) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kLo9D-0001CI-Gu for qemu-devel@nongnu.org; Fri, 25 Sep 2020 09:52:35 -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-559-Gy8wMNSgNx659DFhM52gmg-1; Fri, 25 Sep 2020 09:52:03 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id DD2F3802B78; Fri, 25 Sep 2020 13:51:57 +0000 (UTC) Received: from localhost (unknown [10.36.110.56]) by smtp.corp.redhat.com (Postfix) with ESMTP id D169568D92; Fri, 25 Sep 2020 13:51:41 +0000 (UTC) Dkim-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1601041945; 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=U8Eg3lbPJvwI4xpvtu9t+UA0ObSYSHoLboKrellfB5vsY4YPorrlAFckIpxONJcPBOSRpa BFKJIUG0NOsZvVpIjIHvfq+0A6DY9knaAGYj7otKUd0PJp6esNMt30IhEko07ZDnMAYj7B tV5Gaw4wgeqGw+7p0eKXY9E4cA6z2So= X-MC-Unique: Gy8wMNSgNx659DFhM52gmg-1 From: marcandre.lureau@redhat.com To: qemu-devel@nongnu.org Subject: [PATCH v2 2/6] edid: use physical dimensions if available Date: Fri, 25 Sep 2020 17:50:53 +0400 Message-Id: <20200925135057.291556-3-marcandre.lureau@redhat.com> In-Reply-To: <20200925135057.291556-1-marcandre.lureau@redhat.com> References: <20200925135057.291556-1-marcandre.lureau@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 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/25 02:48:20 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -32 X-Spam_score: -3.3 X-Spam_bar: --- X-Spam_report: (-3.3 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-1.199, 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=0.001, RCVD_IN_MSPIKE_WL=0.001, 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 Wed May 15 05:42:55 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=1601042245; cv=none; d=zohomail.com; s=zohoarc; b=Yujc4Bk3McVNdn5TISEU8b0lPYv3XczkXtz19cBxd9mKJCf3T9L8ULps+HDeTa96oAIJMHEBbeJcx1mlVimSLd23AnReQ2pJOl9IRUqP5v3HY9kRqvNnO6q3E3CNFN3CNSCbiskRYkXMlERtuCWYT1llOx5WNRj4Z2Xx5fRZZMY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1601042245; 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=Ps06ptQc3JzFnCkfEnuwc1n0z1q8DEhijefXDgC8I08dc4gKHgsvng/Zb8aBa/GgtZ7heHsjj2Rrl0VTjckLFI3rSUrnAAKhnVgXrogr67Bvhkfu4q+f+1ezm+DFJwp7kbwtS3kwC5LR3UOU16rROJcZGjVINETMCdu+Mc+9kmU= 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 16010422457515.46335056221983; Fri, 25 Sep 2020 06:57:25 -0700 (PDT) Received: from localhost ([::1]:33070 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kLoE0-0004bF-BQ for importer@patchew.org; Fri, 25 Sep 2020 09:57:24 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:35972) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kLo9F-0007Bn-RA for qemu-devel@nongnu.org; Fri, 25 Sep 2020 09:52:29 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:60979) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kLo99-0001By-Pr for qemu-devel@nongnu.org; Fri, 25 Sep 2020 09:52:29 -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-287-6xHuarKeMle2hTrLyRsqfA-1; Fri, 25 Sep 2020 09:52:17 -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 44B471018F89; Fri, 25 Sep 2020 13:52:14 +0000 (UTC) Received: from localhost (unknown [10.36.110.56]) by smtp.corp.redhat.com (Postfix) with ESMTP id AA4857B7A3; Fri, 25 Sep 2020 13:52:02 +0000 (UTC) Dkim-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1601041939; 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=Uv+8OoGBDWR0FWEBF6+H74hR4qeCR3GWcNuOUmyUmA8WmzAhPijtB7yKNSKW77+b7WXJCb 3BI1lBvjmQ+UgdOdoh+DIh2b83QM1ggdeVVlKdhrcnZllY4xRaIiKK7GQ8p0uX2ZJ2KBYJ Zw4m7B8oXGF806qzovYcmjAqSe8U2iE= X-MC-Unique: 6xHuarKeMle2hTrLyRsqfA-1 From: marcandre.lureau@redhat.com To: qemu-devel@nongnu.org Subject: [PATCH v2 3/6] ui: add getter for UIInfo Date: Fri, 25 Sep 2020 17:50:54 +0400 Message-Id: <20200925135057.291556-4-marcandre.lureau@redhat.com> In-Reply-To: <20200925135057.291556-1-marcandre.lureau@redhat.com> References: <20200925135057.291556-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/25 02:48:20 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -32 X-Spam_score: -3.3 X-Spam_bar: --- X-Spam_report: (-3.3 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-1.199, 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=0.001, RCVD_IN_MSPIKE_WL=0.001, 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 Wed May 15 05:42:55 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=1601042362; cv=none; d=zohomail.com; s=zohoarc; b=etmMpqCLr8vQQLW9hhM5aYUqY5iJ6kITR556TvAqOH+n5UUJEA5roS7XoWnxKcIhtcuVGIXhnGL/yX5wzEj5HCxivqJluvH0ao6C3tqpig7q/GroEvM2/IJUCdmFQe4GJJYWWtBrnJ08I5KZj+qyMGTEeuuhFUoXjaLe5Z2EY5M= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1601042362; 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=mup3NEbp0Dpvs3WHVpjN1m4nrT7itnDVjBhjNqJQjM0eeetkTrcUdrewxbFId3T2Z68IRgFZDpfnbdjN+xYptVC+bAIvKJQavlYD7xfrnShb2tg48OSmmKYYFPdPaHutAA3EP1GSGb8JY6ZfgSjfShHtiQbgZKVkzvmo2lTMZZc= 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 1601042362506714.0997781554112; Fri, 25 Sep 2020 06:59:22 -0700 (PDT) Received: from localhost ([::1]:40532 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kLoFs-0007lf-Sz for importer@patchew.org; Fri, 25 Sep 2020 09:59:20 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:36108) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kLo9b-0007WY-ME for qemu-devel@nongnu.org; Fri, 25 Sep 2020 09:52:51 -0400 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:38019) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kLo9V-0001Eo-2o for qemu-devel@nongnu.org; Fri, 25 Sep 2020 09:52:50 -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-524-smtO4rB3MaStHgHX8zcFJA-1; Fri, 25 Sep 2020 09:52:31 -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 C6189AF204; Fri, 25 Sep 2020 13:52:30 +0000 (UTC) Received: from localhost (unknown [10.36.110.56]) by smtp.corp.redhat.com (Postfix) with ESMTP id 6FE341002C17; Fri, 25 Sep 2020 13:52:18 +0000 (UTC) Dkim-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1601041964; 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=BTuyQgp/N24hDAWCDP19Rtm4aIdrPxHtAoG3iypjGxQ/zipQEAM9nd7/TLsax31gAsxaJM MmfuEzkQ21wL/bbo3XEx3huZDxzvq8Mkx7plEim0oCjgccR2CeVMK6HRHKVQrMZxL03fK4 oBGYj+MEWA/1A47M7AYPJF6/qyn75nU= X-MC-Unique: smtO4rB3MaStHgHX8zcFJA-1 From: marcandre.lureau@redhat.com To: qemu-devel@nongnu.org Subject: [PATCH v2 4/6] spice: remove the single monitor config logic Date: Fri, 25 Sep 2020 17:50:55 +0400 Message-Id: <20200925135057.291556-5-marcandre.lureau@redhat.com> In-Reply-To: <20200925135057.291556-1-marcandre.lureau@redhat.com> References: <20200925135057.291556-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/25 01:07:33 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -32 X-Spam_score: -3.3 X-Spam_bar: --- X-Spam_report: (-3.3 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-1.199, 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=0.001, RCVD_IN_MSPIKE_WL=0.001, 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 Wed May 15 05:42:55 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=1601042514; cv=none; d=zohomail.com; s=zohoarc; b=MIJYq0536D2N/Dcf8XRK7rkR+MIxYo3fbDm9A5Xwb55bQF5kexY2qKgVP66agxtaY3S9btlsZ2i4/BV8ncCc8XONhVAe2S8uHKDIQMLSFs8cTvspcgMrI+UJCiXBZfUOmMtL+VzMLj8lBrtNLg74ZAmuYB3wzT9x2bjBTJRFXZM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1601042514; 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=w4av3mu/X0bQUvY/Z1ZG8P/ZXnjDHHI0bCj1uOdx9N8=; b=PjBduh6japNz5J/zFlXQ59fDwCu1MlDHnWJw8iOP0LNVySZT+tJPWIw7zDhCo2+7g6FkZI3UEU6OIuwuKE9ucnMXQX+VzIDku4LCjDDeZWyWk3cAHMvDoxDuPfV4EbJzYf6/tOZ5nyIVTb36TKTztO548Msi75IQL8aoqEvc4bU= 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 160104251414858.570853545896625; Fri, 25 Sep 2020 07:01:54 -0700 (PDT) Received: from localhost ([::1]:46406 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kLoIK-0001zX-Me for importer@patchew.org; Fri, 25 Sep 2020 10:01:52 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:36160) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kLo9f-0007Y5-QI for qemu-devel@nongnu.org; Fri, 25 Sep 2020 09:53:01 -0400 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:20245) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kLo9d-0001FQ-Qg for qemu-devel@nongnu.org; Fri, 25 Sep 2020 09:52:55 -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-574-jNENJJaYNgO-RBv7uw8YKg-1; Fri, 25 Sep 2020 09:52:47 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 97D4EAF20B; Fri, 25 Sep 2020 13:52:45 +0000 (UTC) Received: from localhost (unknown [10.36.110.56]) by smtp.corp.redhat.com (Postfix) with ESMTP id 309E65C1C2; Fri, 25 Sep 2020 13:52:35 +0000 (UTC) Dkim-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1601041969; 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=w4av3mu/X0bQUvY/Z1ZG8P/ZXnjDHHI0bCj1uOdx9N8=; b=PyEDghOGitirRu3E+YK3JaKBIy+N82IIlDEWgeLAg4mulf5E/FLfMRjTIcIvepZLmLhBWW jOwcHdnvywJfQtBqyHq980pGD5E89a+ArAi21U+VDvz6Ien/EtVWrSKh7xRU/TwQhwBGlU fZ0XynWIjwcipq0xk9bUD5wMygnXNog= X-MC-Unique: jNENJJaYNgO-RBv7uw8YKg-1 From: marcandre.lureau@redhat.com To: qemu-devel@nongnu.org Subject: [PATCH v2 5/6] spice: get monitors physical dimension Date: Fri, 25 Sep 2020 17:50:56 +0400 Message-Id: <20200925135057.291556-6-marcandre.lureau@redhat.com> In-Reply-To: <20200925135057.291556-1-marcandre.lureau@redhat.com> References: <20200925135057.291556-1-marcandre.lureau@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 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/25 01:07:33 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -32 X-Spam_score: -3.3 X-Spam_bar: --- X-Spam_report: (-3.3 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-1.199, 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=0.001, RCVD_IN_MSPIKE_WL=0.001, 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 Note that for consistency, we use the same logic as MonitorsConfig to figure out the associated monitor. However, I can't find traces of the discussion/patches about the "new spice-server" behaviour: it still uses the multiple-configurations path in git master. Signed-off-by: Marc-Andr=C3=A9 Lureau --- include/ui/console.h | 3 +++ ui/spice-display.c | 9 +++++++++ 2 files changed, 12 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..a10f72bc5c 100644 --- a/ui/spice-display.c +++ b/ui/spice-display.c @@ -679,7 +679,16 @@ static int interface_client_monitors_config(QXLInstanc= e *sin, 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_monitors= ]; =20 + if (mc->num_of_monitors > head) { + info.width_mm =3D mm[head].width; + info.height_mm =3D mm[head].height; + } + } +#endif trace_qemu_spice_ui_info(ssd->qxl.id, info.width, info.height); dpy_set_ui_info(ssd->dcl.con, &info); return 1; --=20 2.26.2 From nobody Wed May 15 05:42:55 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=1601042555; cv=none; d=zohomail.com; s=zohoarc; b=WXxclq5NFu9IE5+bqYKDwoWRQtHnglMz35XSCyMMjgzJnxDtNXxDMkPV4p/dGDL+9MLchHvQKQR5n9z7a6R69kkqLw2ZRxaa/wKmLBv4P01cUDSgFZ+LcPBipiC/KbSxMws0PsdNoAI824KbTwk+OD9J9c3U0YHKSonyZ6lRuYQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1601042555; 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=DyIDl0OxOtUdT9cb03Y5ZWfky8jgCn6EBWDm7S5dvv/0LTzg2RjI4LB7pTaLFnT1iy2CmLGfwg4nJQXZIQsoBnAQU0+ZZ66AdDPqX4fU8UT8Z7tjvsLYsNojTHm4WXjrsDKmcGlF76s8QWE0K8ubeyJmmvZXLjU6y1R49Ep0k64= 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 1601042555287549.7829894539689; Fri, 25 Sep 2020 07:02:35 -0700 (PDT) Received: from localhost ([::1]:48174 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kLoIz-0002kR-Qo for importer@patchew.org; Fri, 25 Sep 2020 10:02:33 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:36230) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kLo9y-0007k0-QY for qemu-devel@nongnu.org; Fri, 25 Sep 2020 09:53:15 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:40702) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kLo9u-0001IS-0c for qemu-devel@nongnu.org; Fri, 25 Sep 2020 09:53:14 -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-371-MjvUL94UMTyXjLVelvq5eg-1; Fri, 25 Sep 2020 09:53:03 -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 4AE0110BBED4; Fri, 25 Sep 2020 13:53:02 +0000 (UTC) Received: from localhost (unknown [10.36.110.56]) by smtp.corp.redhat.com (Postfix) with ESMTP id B19D960CCC; Fri, 25 Sep 2020 13:52:49 +0000 (UTC) Dkim-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1601041989; 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=aw0R0fum+7vvcsDbU1/I+zt6YD4nsjfx2Q79Tgq+DkPZNoJHL2C819/q+B305YAzOGvlYv 6eZDYSX2CYVJCwtXMijHAWahdseSyr6ijJ18xiDFl3kP/z6PEr1+6WuQSnlpNO8xSrdE1f ExdR9Nmbgmr5Pe4YV9c/4gP+nCKdrFU= X-MC-Unique: MjvUL94UMTyXjLVelvq5eg-1 From: marcandre.lureau@redhat.com To: qemu-devel@nongnu.org Subject: [PATCH v2 6/6] virtio-gpu: set physical dimensions for EDID Date: Fri, 25 Sep 2020 17:50:57 +0400 Message-Id: <20200925135057.291556-7-marcandre.lureau@redhat.com> In-Reply-To: <20200925135057.291556-1-marcandre.lureau@redhat.com> References: <20200925135057.291556-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/25 02:48:20 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -32 X-Spam_score: -3.3 X-Spam_bar: --- X-Spam_report: (-3.3 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-1.199, 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=0.001, RCVD_IN_MSPIKE_WL=0.001, 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