From nobody Thu Nov 13 20:40:38 2025 Delivered-To: importer@patchew.org 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; Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1582719914; cv=none; d=zohomail.com; s=zohoarc; b=bMFcrW3LDfdgGppm7D1WvTHbTdChNm0BcSehvUe24y+Wsq/0UwLWLH6ehoQStksNSLm0RTNHEGt/k0h3T1QyKOt1TRt4pmvxgpnPo0KF64oktfK5f4/zsWlqVlQS2yD/QAIOaU5S6rIy4IKtTowWFE/wc9Ytl44Wtu2/NBFY4AQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1582719914; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To; bh=RapIgoTmpltecsVuyObI0J0XRIqqhTW2JnTGsmftNn0=; b=hfdfOgayvnIZ/1PvcqQPJiBv/gb27blZSW9NqZDJG7rpMQ2psnlBsq3if288mMaXh4v9qk4tDn62Fu4DHA+7PcV8hSi6SAyFL8x/gUDlwkuZLflWl7eN+tretqRL/0zQeXOhPiFjw0/Dyf1+KK4iIsPWAJJ+NTBZFuUvky+nwMY= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1582719914633791.7385682770118; Wed, 26 Feb 2020 04:25:14 -0800 (PST) Received: from localhost ([::1]:43510 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j6vkX-0002LQ-Cj for importer@patchew.org; Wed, 26 Feb 2020 07:25:13 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:53379) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j6vgT-0002RD-4i for qemu-devel@nongnu.org; Wed, 26 Feb 2020 07:21:04 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1j6vgP-0007qo-El for qemu-devel@nongnu.org; Wed, 26 Feb 2020 07:21:00 -0500 Received: from vmicros1.altlinux.org ([194.107.17.57]:36960) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1j6vgP-0007no-6S for qemu-devel@nongnu.org; Wed, 26 Feb 2020 07:20:57 -0500 Received: from imap.altlinux.org (imap.altlinux.org [194.107.17.38]) by vmicros1.altlinux.org (Postfix) with ESMTP id 498C772CCEF; Wed, 26 Feb 2020 15:20:55 +0300 (MSK) Received: from table.localdomain (109-252-52-89.nat.spd-mgts.ru [109.252.52.89]) by imap.altlinux.org (Postfix) with ESMTPSA id 2EE5C4A4A16; Wed, 26 Feb 2020 15:20:55 +0300 (MSK) Date: Wed, 26 Feb 2020 15:20:54 +0300 From: "Anton V. Boyarshinov" To: Gerd Hoffmann Subject: [PATCH v2] Arithmetic error in EDID generation fixed Message-ID: <20200226122054.366b9cda@table.localdomain> Organization: ALT Linux X-Mailer: Claws Mail 3.17.3 (GTK+ 2.24.32; x86_64-alt-linux-gnu) MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x (no timestamps) [generic] [fuzzy] X-Received-From: 194.107.17.57 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: shaba@altlinux.org, qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" To calculate screen size in centimeters we should calculate: pixels/dpi*2.54 but not pixels*dpi/2540 Using wrong formula we actually get 65 DPI and very small fonts. Signed-off-by: Anton V. Boyarshinov --- Changes from v1: get rid of casts 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 75c945a948..e58472fde5 100644 --- a/hw/display/edid-generate.c +++ b/hw/display/edid-generate.c @@ -360,8 +360,8 @@ void qemu_edid_generate(uint8_t *edid, size_t size, edid[20] =3D 0xa5; =20 /* screen size: undefined */ - edid[21] =3D info->prefx * info->dpi / 2540; - edid[22] =3D info->prefy * info->dpi / 2540; + edid[21] =3D info->prefx * 254 / 100 / info->dpi; + edid[22] =3D info->prefy * 254 / 100 / info->dpi; =20 /* display gamma: 2.2 */ edid[23] =3D 220 - 100; --=20 2.21.0