From 4d18413c285100a7bafb8c6b970724c174e70193 Mon Sep 17 00:00:00 2001 From: Simon Ser Date: Wed, 5 Oct 2022 09:58:00 +0200 Subject: [PATCH] di-edid-decode: add special case for 16:10 aspect ratio The mathematical aspect ratio is 8:5 but people use 16:10. Signed-off-by: Simon Ser --- di-edid-decode/edid.c | 5 +++++ test/data/dell-2408wfp-dp.diff | 11 +++++++++++ 2 files changed, 16 insertions(+) create mode 100644 test/data/dell-2408wfp-dp.diff diff --git a/di-edid-decode/edid.c b/di-edid-decode/edid.c index cc032d2..2eb36af 100644 --- a/di-edid-decode/edid.c +++ b/di-edid-decode/edid.c @@ -114,6 +114,11 @@ compute_aspect_ratio(int width, int height, int *horiz_ratio, int *vert_ratio) *horiz_ratio = width / d; *vert_ratio = height / d; } + + if (*horiz_ratio == 8 && *vert_ratio == 5) { + *horiz_ratio = 16; + *vert_ratio = 10; + } } /** diff --git a/test/data/dell-2408wfp-dp.diff b/test/data/dell-2408wfp-dp.diff new file mode 100644 index 0000000..90f70d4 --- /dev/null +++ b/test/data/dell-2408wfp-dp.diff @@ -0,0 +1,11 @@ +--- ref ++++ di +@@ -33,7 +33,7 @@ + DMT 0x33: 1600x1200 60.000000 Hz 4:3 75.000 kHz 162.000000 MHz + DMT 0x15: 1152x864 75.000000 Hz 4:3 67.500 kHz 108.000000 MHz + Detailed Timing Descriptors: +- DTD 1: 1920x1200 59.950171 Hz 8:5 74.038 kHz 154.000000 MHz (519 mm x 320 mm) ++ DTD 1: 1920x1200 59.950171 Hz 16:10 74.038 kHz 154.000000 MHz (519 mm x 320 mm) + Hfront 48 Hsync 32 Hback 80 Hpol P + Vfront 3 Vsync 6 Vback 26 Vpol N + Display Product Serial Number: 'G283H8BI21MS'