aboutsummaryrefslogtreecommitdiff
path: root/hw/display/edid-generate.c
diff options
context:
space:
mode:
authorMarc-André Lureau <marcandre.lureau@redhat.com>2020-09-27 18:57:46 +0400
committerGerd Hoffmann <kraxel@redhat.com>2020-09-29 10:08:25 +0200
commit6c8f847ac1356387692f224b48c7a83ac5918b5d (patch)
tree39526abefb826b407f6886b57863a017d8681b3a /hw/display/edid-generate.c
parent3745d59ee489bccdab8f678a0f7972e7dbe189f9 (diff)
downloadqemu-6c8f847ac1356387692f224b48c7a83ac5918b5d.zip
qemu-6c8f847ac1356387692f224b48c7a83ac5918b5d.tar.gz
qemu-6c8f847ac1356387692f224b48c7a83ac5918b5d.tar.bz2
edid: fix physical display size computation
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>
Diffstat (limited to 'hw/display/edid-generate.c')
-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 e58472f..618c74e 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;