[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v3 1/6] edid: fix physical display size computation
From: |
marcandre . lureau |
Subject: |
[PATCH v3 1/6] edid: fix physical display size computation |
Date: |
Sun, 27 Sep 2020 18:57:46 +0400 |
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>
---
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 = 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.26.2
- [PATCH v3 0/6] Add physical display dimensions to spice/virtio-gpu, marcandre . lureau, 2020/09/27
- [PATCH v3 1/6] edid: fix physical display size computation,
marcandre . lureau <=
- [PATCH v3 3/6] ui: add getter for UIInfo, marcandre . lureau, 2020/09/27
- [PATCH v3 2/6] edid: use physical dimensions if available, marcandre . lureau, 2020/09/27
- [PATCH v3 4/6] spice: remove the single monitor config logic, marcandre . lureau, 2020/09/27
- [PATCH v3 5/6] spice: get monitors physical dimension, marcandre . lureau, 2020/09/27
- [PATCH v3 6/6] virtio-gpu: set physical dimensions for EDID, marcandre . lureau, 2020/09/27
- Re: [PATCH v3 0/6] Add physical display dimensions to spice/virtio-gpu, no-reply, 2020/09/27
- Re: [PATCH v3 0/6] Add physical display dimensions to spice/virtio-gpu, Gerd Hoffmann, 2020/09/29