aboutsummaryrefslogtreecommitdiff
path: root/hw
diff options
context:
space:
mode:
authorAnton V. Boyarshinov <boyarsh@altlinux.org>2020-02-26 15:20:54 +0300
committerGerd Hoffmann <kraxel@redhat.com>2020-03-02 08:20:30 +0100
commitcd8fef8d4b2dfeadc68ffb4d741ab23e9e13dad1 (patch)
tree09956f00c4a6edc0f5252ce98765a0bb52620077 /hw
parente0175b71638cf4398903c0d25f93fe62e0606389 (diff)
Arithmetic error in EDID generation fixed
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 <boyarsh@altlinux.org> Message-id: 20200226122054.366b9cda@table.localdomain Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Diffstat (limited to 'hw')
-rw-r--r--hw/display/edid-generate.c4
1 files 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] = 0xa5;
/* screen size: undefined */
- edid[21] = info->prefx * info->dpi / 2540;
- edid[22] = info->prefy * info->dpi / 2540;
+ edid[21] = info->prefx * 254 / 100 / info->dpi;
+ edid[22] = info->prefy * 254 / 100 / info->dpi;
/* display gamma: 2.2 */
edid[23] = 220 - 100;