[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PULL 1/2] Arithmetic error in EDID generation fixed
From: |
Stefan Weil |
Subject: |
Re: [PULL 1/2] Arithmetic error in EDID generation fixed |
Date: |
Thu, 5 Mar 2020 15:31:50 +0100 |
User-agent: |
Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:68.0) Gecko/20100101 Thunderbird/68.5.0 |
Am 02.03.20 um 10:18 schrieb Gerd Hoffmann:
> From: "Anton V. Boyarshinov" <address@hidden>
>
> 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 <address@hidden>
> Message-id: 20200226122054.366b9cda@table.localdomain
> Signed-off-by: Gerd Hoffmann <address@hidden>
> ---
> 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 75c945a94813..e58472fde501 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;
Gerd, the required rounding (see my previous e-mail) for both values is
still missing.
Cheers,
Stefan