[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 2/9] edid: fix physical display size computation
From: |
Gerd Hoffmann |
Subject: |
[PULL 2/9] edid: fix physical display size computation |
Date: |
Tue, 29 Sep 2020 11:57:10 +0200 |
From: Marc-André Lureau <marcandre.lureau@redhat.com>
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é Lureau <marcandre.lureau@redhat.com>
Message-id: 20200927145751.365446-2-marcandre.lureau@redhat.com
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
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 e58472fde501..618c74e1df39 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 = xres * dpi / 254;
- uint32_t ymm = yres * dpi / 254;
+ uint32_t xmm = xres * 254 / 10 / dpi;
+ uint32_t ymm = yres * 254 / 10 / dpi;
/* pull some realistic looking timings out of thin air */
uint32_t xfront = xres * 25 / 100;
--
2.27.0
- [PULL 0/9] Vga 20200929 patches, Gerd Hoffmann, 2020/09/29
- [PULL 1/9] virtio-gpu-3d: fix abnormal display after a warm reboot, Gerd Hoffmann, 2020/09/29
- [PULL 4/9] ui: add getter for UIInfo, Gerd Hoffmann, 2020/09/29
- [PULL 9/9] ppc/pseries: enable big-endian-framebuffer quirk for bochs-display and virtio-vga, Gerd Hoffmann, 2020/09/29
- [PULL 8/9] virtio-vga: implement big-endian-framebuffer property, Gerd Hoffmann, 2020/09/29
- [PULL 7/9] virtio-gpu: set physical dimensions for EDID, Gerd Hoffmann, 2020/09/29
- [PULL 2/9] edid: fix physical display size computation,
Gerd Hoffmann <=
- [PULL 5/9] spice: remove the single monitor config logic, Gerd Hoffmann, 2020/09/29
- [PULL 6/9] spice: get monitors physical dimension, Gerd Hoffmann, 2020/09/29
- [PULL 3/9] edid: use physical dimensions if available, Gerd Hoffmann, 2020/09/29
- Re: [PULL 0/9] Vga 20200929 patches, Peter Maydell, 2020/09/29