[edid-decode 4/7] Print the HDMI resolution next to the HDMI VICs

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

 



Signed-off-by: Damien Lespiau <damien.lespiau@xxxxxxxxx>
---
 edid-decode.c | 21 +++++++++++++++++++--
 1 file changed, 19 insertions(+), 2 deletions(-)

diff --git a/edid-decode.c b/edid-decode.c
index 55e48a7..5061228 100644
--- a/edid-decode.c
+++ b/edid-decode.c
@@ -659,6 +659,13 @@ cea_video_block(unsigned char *x)
     }
 }
 
+static const char *edid_cea_hdmi_modes[] = {
+    "3840x2160@30Hz",
+    "3840x2160@25Hz",
+    "3840x2160@24Hz",
+    "4096x2160@24Hz",
+};
+
 static void
 cea_hdmi_block(unsigned char *x)
 {
@@ -737,8 +744,18 @@ cea_hdmi_block(unsigned char *x)
 	    if (len_vic) {
 		int i;
 
-		for (i = 0; i < len_vic; i++)
-		    printf("      HDMI VIC %d\n", x[9 + b + i]);
+		for (i = 0; i < len_vic; i++) {
+                    unsigned char vic = x[9 + b + i];
+                    const char *mode;
+
+                    vic--;
+                    if (vic < ARRAY_SIZE(edid_cea_hdmi_modes))
+                            mode = edid_cea_hdmi_modes[vic];
+                    else
+                            mode = "Unknown mode";
+
+		    printf("      HDMI VIC %d %s\n", vic, mode);
+                }
 
 		b += len_vic;
 	    }
-- 
1.8.3.1

_______________________________________________
dri-devel mailing list
dri-devel@xxxxxxxxxxxxxxxxxxxxx
http://lists.freedesktop.org/mailman/listinfo/dri-devel




[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux