Skip to contentSkip to conversation

Add a missing comma to the list of CEA VICs

PATCH In review Thomas Wood 2 participants 5 messages Sep 27, 2013

lore
Share & tools
lore
#0 lore raw

PATCH 1/3 Add a missing comma to the list of CEA VICs

---
 edid-decode.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
edid-decode.c +1 -1
index d3e3118..3830e0c 100644
@@ -649,7 +649,7 @@ static const char *edid_cea_modes[] = {
     "1440x240@60Hz",
     "1440x240@60Hz",
     "2880x480i@60Hz",
-    "2880x480i@60Hz"
+    "2880x480i@60Hz",
     "2880x240@60Hz",
     "2880x240@60Hz",
     "1440x480@60Hz",
Signature · 1 line
1.8.3.1
#1 lore raw

PATCH 2/3 Include the last VIC in the CEA video block

---
 edid-decode.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
edid-decode.c +1 -1
index 3830e0c..b710bb5 100644
@@ -711,7 +711,7 @@ cea_video_block(unsigned char *x)
     int i;
     int length = x[0] & 0x1f;
 
-    for (i = 1; i < length; i++)  {
+    for (i = 1; i <= length; i++)  {
 	unsigned char vic = x[i] & 0x7f;
 	unsigned char native = x[i] & 0x80;
 	const char *mode;
Signature · 1 line
1.8.3.1
#2 lore raw

PATCH 3/3 Print the correct VIC number next to the mode

In reply to Thomas Wood
---
 edid-decode.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
edid-decode.c +4 -3
index b710bb5..4265843 100644
@@ -715,10 +715,11 @@ cea_video_block(unsigned char *x)
 	unsigned char vic = x[i] & 0x7f;
 	unsigned char native = x[i] & 0x80;
 	const char *mode;
+	int index;
 
-	vic--;
-	if (vic < ARRAY_SIZE(edid_cea_modes))
-	    mode = edid_cea_modes[vic];
+	index = vic - 1;
+	if (index < ARRAY_SIZE(edid_cea_modes))
+	    mode = edid_cea_modes[index];
 	else
 	    mode = "Unknown mode";
 
Signature · 1 line
1.8.3.1