[PATCH 09/11] edid-decode: allow undefined aspect ratio

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Distinguish between "undefined" and "reserved" aspect ratios. See examples apple-xdr-6k-tile0, lg-ultrafine-5k-v1-thunderbolt-dp1-tile0, asus-xg438q-dp
"undefined" is for an aspect ratio that doesn't exist in the list of known aspect ratios. This does not deserve a fail.
"reserved" should not be used and still deserves the fail.

Signed-off-by: Joe van Tunen <joevt@xxxxxxx>
---
 parse-displayid-block.cpp | 16 ++++++++++------
 1 file changed, 10 insertions(+), 6 deletions(-)

diff --git a/parse-displayid-block.cpp b/parse-displayid-block.cpp
index 9713c46..8f4e366 100644
--- a/parse-displayid-block.cpp
+++ b/parse-displayid-block.cpp
@@ -270,10 +270,12 @@ void edid_state::parse_displayid_type_1_7_timing(const unsigned char *x,
 		t.hratio = 256;
 		t.vratio = 135;
 		break;
-	default:
+	case 8:
 		s += "undefined";
-		if ((x[3] & 0xf) > (dispid.version <= 0x12 ? 7 : 8))
-			fail("Unknown aspect 0x%02x.\n", x[3] & 0xf);
+		break;
+	default:
+		s += "reserved";
+		fail("Unknown aspect 0x%02x.\n", x[3] & 0xf);
 		break;
 	}
 	switch ((x[3] >> 5) & 0x3) {
@@ -455,10 +457,12 @@ void edid_state::parse_displayid_type_3_timing(const unsigned char *x)
 		t.hratio = 256;
 		t.vratio = 135;
 		break;
-	default:
+	case 8:
 		s += "undefined";
-		if ((x[3] & 0xf) > (dispid.version <= 0x12 ? 7 : 8))
-			fail("Unknown aspect 0x%02x.\n", x[3] & 0xf);
+		break;
+	default:
+		s += "reserved";
+		fail("Unknown aspect 0x%02x.\n", x[0] & 0xf);
 		break;
 	}
 
-- 
2.24.3 (Apple Git-128)





[Index of Archives]     [Linux Input]     [Video for Linux]     [Gstreamer Embedded]     [Mplayer Users]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]

  Powered by Linux