From nobody Thu May 2 19:39:27 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=1600323892; cv=none; d=zohomail.com; s=zohoarc; b=B+ccKMYyv0GbwMH6cx2s7g35Yn7lmuZbj8pIuKZs4ZnbjvRe/h6PU0SJ8j88yKiAa0P+Or5MC1nzBp7+fWYU4wMM0M+XFMfCUQWB9sxzns0tUTF1QvAwoe/CfgZpTb7+AfYC2EwUx/3LDy9qrBUfRYqWoj9zZl6FAbS50Z/f3Ig= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1600323892; 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=iPhndeu/LJpPCP+1adHRANdLeq8Z5tSpC8QYv1z8iTqnI6FXjQK+2WfF1dMeW+fEte+Zw70USFhFaL0xKAzpmbdAeEKBhSXp02ToiYitI/2RJrKr8V4KtOgGF4SgsrflxTXnsmzf2u1a5Qc9GH4ee7zvKlbvyUm+OFOqCvNXsVE= 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 1600323892929896.404450565493; Wed, 16 Sep 2020 23:24:52 -0700 (PDT) Received: from localhost ([::1]:55308 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kInLf-0006Dl-Nn for importer@patchew.org; Thu, 17 Sep 2020 02:24:51 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:60342) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kInJw-0004hC-Ey for qemu-devel@nongnu.org; Thu, 17 Sep 2020 02:23:06 -0400 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:25635) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kInJu-0002jk-G2 for qemu-devel@nongnu.org; Thu, 17 Sep 2020 02:23:04 -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-88-sSl5fiavOA-6RD5ezeQrPw-1; Thu, 17 Sep 2020 02:23:00 -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 41CE7186DD2A for ; Thu, 17 Sep 2020 06:22:59 +0000 (UTC) Received: from localhost (unknown [10.36.110.44]) by smtp.corp.redhat.com (Postfix) with ESMTP id 56F217BE44; Thu, 17 Sep 2020 06:22:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1600323781; 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=D890UBYokZy5sYmdIeIlObrrIwVB+yiv/0zrte8gSPo3jCowSV0Cc9nei3qiLbKFRlMcp2 5YCDyxnsbYNbGlpWe80rRoY7PQyUHo7Be0zdP9uvBH72I7fxeOv4lr8wchOr9slwmnChYe 2objZS4MoD2poTBX8y0vF5cM2kV98gk= X-MC-Unique: sSl5fiavOA-6RD5ezeQrPw-1 From: marcandre.lureau@redhat.com To: qemu-devel@nongnu.org Subject: [PATCH 1/5] edid: fix physical display size computation Date: Thu, 17 Sep 2020 10:22:38 +0400 Message-Id: <20200917062242.1877925-2-marcandre.lureau@redhat.com> In-Reply-To: <20200917062242.1877925-1-marcandre.lureau@redhat.com> References: <20200917062242.1877925-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/16 20:51:18 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -50 X-Spam_score: -5.1 X-Spam_bar: ----- X-Spam_report: (-5.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-2.999, 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: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Gerd Hoffmann 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 Thu May 2 19:39:27 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=1600323914; cv=none; d=zohomail.com; s=zohoarc; b=CgsVQ4zvar+4LYz4Fxmls8ShH+zBbHtt/AqEnmO9KMBb2y1B58LU7V7bZdcSm+UAcvEpp9vwS1VnLp+d+bw5TDWejO6Ht20zqdDzX07GO+0odM8ukbQ+ND/L6aRWqoA/IBNimaeGCWcNuVeb5IUTruSkwjd1BQ51+OdgyXmJ2yg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1600323914; 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=FLZor5bpmCRYT8zBTeqmaQ76frJOWjUNoJ5cyaecrdrm6MFu7O4pZdK9WGOKBjGETYM8SA5hLq8z8DqxOqXRj0sw2r3ZKz427KbItPPO0i+IybHfcHfjUQ2WaJuI1RvseqhCe/Cjs0oW6rKdg7OCphQ0J6JyJkB9vnyMGFZwaSs= 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 1600323914730887.9859701223556; Wed, 16 Sep 2020 23:25:14 -0700 (PDT) Received: from localhost ([::1]:57510 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kInM1-00077c-JL for importer@patchew.org; Thu, 17 Sep 2020 02:25:13 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:60480) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kInKZ-0005Q5-EQ for qemu-devel@nongnu.org; Thu, 17 Sep 2020 02:23:44 -0400 Received: from us-smtp-1.mimecast.com ([205.139.110.61]:30583 helo=us-smtp-delivery-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kInKV-0002rK-O4 for qemu-devel@nongnu.org; Thu, 17 Sep 2020 02:23: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-468-E7qC6wjHOmKYu4QAa3dFtw-1; Thu, 17 Sep 2020 02:23:11 -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 816BF64085 for ; Thu, 17 Sep 2020 06:23:10 +0000 (UTC) Received: from localhost (unknown [10.36.110.44]) by smtp.corp.redhat.com (Postfix) with ESMTP id 179FC1002D52; Thu, 17 Sep 2020 06:23:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1600323818; 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=gG36MGcr1B5mVThqoiL2uESixmB37Preg+x3sQaNMRkZjmKElVP/kUs16STsgcgufaCtdD P3OIZARw0HexkEdyyp5bVAgqyvPF1thD3gfVn34GVHB7C6jg1dY6mZ+K7PDQcS+ktd8OyI /CRsLk5qAPWfxHwR0/IMrwMPuDdI2OU= X-MC-Unique: E7qC6wjHOmKYu4QAa3dFtw-1 From: marcandre.lureau@redhat.com To: qemu-devel@nongnu.org Subject: [PATCH 2/5] edid: use physical dimensions if available Date: Thu, 17 Sep 2020 10:22:39 +0400 Message-Id: <20200917062242.1877925-3-marcandre.lureau@redhat.com> In-Reply-To: <20200917062242.1877925-1-marcandre.lureau@redhat.com> References: <20200917062242.1877925-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.002 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=205.139.110.61; envelope-from=marcandre.lureau@redhat.com; helo=us-smtp-delivery-1.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/09/17 02:23:38 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -50 X-Spam_score: -5.1 X-Spam_bar: ----- X-Spam_report: (-5.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-2.999, 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_H2=-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: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Gerd Hoffmann 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 Thu May 2 19:39:27 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=1600323966; cv=none; d=zohomail.com; s=zohoarc; b=m1eskGk9PqsqqgjblNWHySfKq8VCbcqeuuF/ixQsIVsUtTsir36bIdId1EPlomVadBqYT+QKhy0HxZhKreB8nJrPfQkZJeBug3UH6S2+qkI8Q6loS3kNpgyDNC6NpkhzUY4iNDG/TCYWjZQz3OmI7MfKIifQEDOQNh7DhMlX5p8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1600323966; 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=pg5iWfmPo4KvUyxvHOPEfTxNabe2ggh0FDmDU3BOtP8=; b=XHqB+WfmzDzTKc2nePsDBUEt15pFzuVAbbWAQU32gMtNMR8p2+X2kZB5WM+pkxtboPnyX/zGVsRpeTN/FUEdKEgoRVCz4dS0XYvejo0IuhwRwHV4IQXGxRdNqh6Oe96U6b36JtDcfesvmhcd4Q9s7MFb31IddQYs1eX/bY+kEUg= 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 1600323966158100.37682423491015; Wed, 16 Sep 2020 23:26:06 -0700 (PDT) Received: from localhost ([::1]:59470 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kInMq-00080R-Vu for importer@patchew.org; Thu, 17 Sep 2020 02:26:05 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:60430) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kInKI-00052F-Uw for qemu-devel@nongnu.org; Thu, 17 Sep 2020 02:23:28 -0400 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:28223) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kInKH-0002pE-8X for qemu-devel@nongnu.org; Thu, 17 Sep 2020 02:23:26 -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-414-cm48Sc1fPhmTlN05dn9shA-1; Thu, 17 Sep 2020 02:23:22 -0400 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 8D200186DD2A for ; Thu, 17 Sep 2020 06:23:21 +0000 (UTC) Received: from localhost (unknown [10.36.110.44]) by smtp.corp.redhat.com (Postfix) with ESMTP id 4F0B019D6C; Thu, 17 Sep 2020 06:23:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1600323804; 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=pg5iWfmPo4KvUyxvHOPEfTxNabe2ggh0FDmDU3BOtP8=; b=MPs7aQ/hlqAx6q+qeINRWpGI5k66Y1cL02jG6/3KAqfkdllU0sdt3nscOwYV226lx0ZR89 uT+StlU2wna2K+xrTK+rmknJKvdUXtDEu6fTmqN+ruM8VhrmLyDwDZpwRL/1To7z1dRvHm W6EnCYMYSwbv586C/Qh8OvxiluZXd6s= X-MC-Unique: cm48Sc1fPhmTlN05dn9shA-1 From: marcandre.lureau@redhat.com To: qemu-devel@nongnu.org Subject: [PATCH 3/5] ui: add getter for UIInfo Date: Thu, 17 Sep 2020 10:22:40 +0400 Message-Id: <20200917062242.1877925-4-marcandre.lureau@redhat.com> In-Reply-To: <20200917062242.1877925-1-marcandre.lureau@redhat.com> References: <20200917062242.1877925-1-marcandre.lureau@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=marcandre.lureau@redhat.com X-Mimecast-Spam-Score: 0.002 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/16 20:51:18 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -50 X-Spam_score: -5.1 X-Spam_bar: ----- X-Spam_report: (-5.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-2.999, 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: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Gerd Hoffmann 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 8602203523..b1b0b74317 100644 --- a/include/ui/console.h +++ b/include/ui/console.h @@ -274,6 +274,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 f8d7643fe4..538b6b6d5b 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 Thu May 2 19:39:27 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=1600324052; cv=none; d=zohomail.com; s=zohoarc; b=Rz40GMpNTVNc8pyK5SKHVUt5ze2Qjt4YtTk+iJHNyeNvnw0TtlEJu6CbNBAybQcH4Upr0diURunyvuBXbwQFHqbq9A6tWpePYbQY+EgpneMoGxJPYxR8F9K9sm/rSTX8xhOq//l8mAZAF/Bjtv2JLSaArPwGo3JvQSaULIkHN9A= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1600324052; 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=ziCp3kCLgwt0IrpskcKmpgnVheJ8yvW5fcXhOtiMXtk=; b=f0LC84k+ZcXm4rVfeyIsM/hLNI4dNzZKRc9EoOWQJhjCn4SogQSXC7BGTGI9kqb4TUT6Mx7Htv2kPl2v82M8hf04CB/asLjQINcKuhEC8TsGqqm/u3SfuJKpw9+G+L9UWkl69hmcaLq4dGmydPeWQP3sanVoaR1lW+TUXYaNC6k= 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 1600324052751615.0648782569448; Wed, 16 Sep 2020 23:27:32 -0700 (PDT) Received: from localhost ([::1]:35028 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kInOF-0001FL-Jz for importer@patchew.org; Thu, 17 Sep 2020 02:27:31 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:60478) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kInKX-0005Pt-3s for qemu-devel@nongnu.org; Thu, 17 Sep 2020 02:23:44 -0400 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:25156) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kInKU-0002rG-Fw for qemu-devel@nongnu.org; Thu, 17 Sep 2020 02:23:40 -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-372-zo0_IHdhOP2ExQiWd0aQQQ-1; Thu, 17 Sep 2020 02:23:34 -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 A4EB71008301 for ; Thu, 17 Sep 2020 06:23:33 +0000 (UTC) Received: from localhost (unknown [10.36.110.44]) by smtp.corp.redhat.com (Postfix) with ESMTP id 1395E60BE5; Thu, 17 Sep 2020 06:23:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1600323817; 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=ziCp3kCLgwt0IrpskcKmpgnVheJ8yvW5fcXhOtiMXtk=; b=ROLy34dTHqT7SJV345banGNyQno1MwjuJHzeT5CxnPkNlDXDIfqfnh72mMAC5LdCHYCRt4 qfyWFI1VnOaJndRSPSarAd9zkCY83oHMdu1k7SQCR5H+R7PKEKPAAN4YTYREmWRjVBxK+O cahPHP+wBd+fKL+lezH02K8Sl+ea+Ug= X-MC-Unique: zo0_IHdhOP2ExQiWd0aQQQ-1 From: marcandre.lureau@redhat.com To: qemu-devel@nongnu.org Subject: [PATCH 4/5] spice: get monitors physical dimension Date: Thu, 17 Sep 2020 10:22:41 +0400 Message-Id: <20200917062242.1877925-5-marcandre.lureau@redhat.com> In-Reply-To: <20200917062242.1877925-1-marcandre.lureau@redhat.com> References: <20200917062242.1877925-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.002 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/16 20:51:18 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -50 X-Spam_score: -5.1 X-Spam_bar: ----- X-Spam_report: (-5.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-2.999, 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: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Gerd Hoffmann 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 | 17 +++++++++++++++++ 2 files changed, 20 insertions(+) diff --git a/include/ui/console.h b/include/ui/console.h index b1b0b74317..dfbd7f2940 100644 --- a/include/ui/console.h +++ b/include/ui/console.h @@ -129,6 +129,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 625d9232b9..2f14d5a080 100644 --- a/ui/spice-display.c +++ b/ui/spice-display.c @@ -674,6 +674,8 @@ static int interface_client_monitors_config(QXLInstance= *sin, =20 info =3D *dpy_get_ui_info(ssd->dcl.con); =20 + /* Note: this code doesn't handle Spice multi-head support, where mult= iple + * monitor configuration for a single QXL device means multiple head. = */ if (mc->num_of_monitors =3D=3D 1) { /* * New spice-server version which filters the list of monitors @@ -697,7 +699,22 @@ static int interface_client_monitors_config(QXLInstanc= e *sin, 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 =3D=3D 1) { + info.width_mm =3D mm[0].width; + info.height_mm =3D mm[0].height; + } else { + head =3D qemu_console_get_index(ssd->dcl.con); + 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 Thu May 2 19:39:27 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=1600324052; cv=none; d=zohomail.com; s=zohoarc; b=Z+yt1xNYIKntNS5OdrJBOE+G0YIeUKTFRFKyg6RjJ/EvjgcbmaZd+t2Mv+jakRZ7ferTxNpMdy2t0Ywp2BdUYBmwolNkR7P6HKgcuJdzgmn7jNeYhIqcz6GiP4rI2QoQQqXlK4lexDncHMKcywk8rnayO6Jj2qTqCd6179S7LME= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1600324052; 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=j2TRHnVVMkouhrkx5NbVUNJa5rmPpVSeoCJNf7SbbdU=; b=TX2wWopt2HwobIWpyepMGRZY/q51cQUHLqdGwLK0ctM6ifulsmoj4/cCDLLOEDr4g3XcKT9v60e+jCwI2Wx6p8FrTPlG1qXgEBggFk4J5zF7Mm8XzZHBUxErWU3dTZytdHxGNihchR16jIwe5s+xbfQ3x1k5KJ3PxhX8porPIT0= 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 1600324052006904.4114128867101; Wed, 16 Sep 2020 23:27:32 -0700 (PDT) Received: from localhost ([::1]:34926 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kInOE-0001Cg-KV for importer@patchew.org; Thu, 17 Sep 2020 02:27:30 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:60500) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kInKi-0005Rx-6P for qemu-devel@nongnu.org; Thu, 17 Sep 2020 02:23:52 -0400 Received: from us-smtp-2.mimecast.com ([205.139.110.61]:22093 helo=us-smtp-delivery-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kInKe-0002rk-UM for qemu-devel@nongnu.org; Thu, 17 Sep 2020 02:23:51 -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-498-jqV-5sPZPu6GnOnMJ9nPZA-1; Thu, 17 Sep 2020 02:23:45 -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 954AE186DD27 for ; Thu, 17 Sep 2020 06:23:44 +0000 (UTC) Received: from localhost (unknown [10.36.110.44]) by smtp.corp.redhat.com (Postfix) with ESMTP id E213010002A6; Thu, 17 Sep 2020 06:23:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1600323827; 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=j2TRHnVVMkouhrkx5NbVUNJa5rmPpVSeoCJNf7SbbdU=; b=JtrW4afi/m8oDDtfAftG0KDxcipoBumHRplkkOKnVXlW4bVhyJDLLAE8shVSq+WzDXj9gM qrysllr7YaNPQ53Bv7zTzr6BKhxELJSlvKquPrbobYsNCkOro6rn0aRR+0IEbhxj8MnshU ge0gse4rsU8C384NBstsnGRDYyUlgy0= X-MC-Unique: jqV-5sPZPu6GnOnMJ9nPZA-1 From: marcandre.lureau@redhat.com To: qemu-devel@nongnu.org Subject: [PATCH 5/5] virtio-gpu: set physical dimensions for EDID Date: Thu, 17 Sep 2020 10:22:42 +0400 Message-Id: <20200917062242.1877925-6-marcandre.lureau@redhat.com> In-Reply-To: <20200917062242.1877925-1-marcandre.lureau@redhat.com> References: <20200917062242.1877925-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.002 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=205.139.110.61; envelope-from=marcandre.lureau@redhat.com; helo=us-smtp-delivery-1.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/09/17 02:23:38 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -50 X-Spam_score: -5.1 X-Spam_bar: ----- X-Spam_report: (-5.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-2.999, 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_H2=-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: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Gerd Hoffmann 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 6b45b4799a..525e4fac4f 100644 --- a/include/hw/virtio/virtio-gpu.h +++ b/include/hw/virtio/virtio-gpu.h @@ -66,6 +66,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