summaryrefslogtreecommitdiff
path: root/tools/edid/bparse-edid
diff options
context:
space:
mode:
authorBrett Weiland <brett_weiland@bpcspace.com>2021-03-19 10:54:25 -0500
committerBrett Weiland <brett_weiland@bpcspace.com>2021-03-19 10:54:25 -0500
commit66289aa8ecfa07b20bad424eb9860b196641ef52 (patch)
tree9fb3915b5cb18d9f2c1f4648d3bf3fb56396509f /tools/edid/bparse-edid
first commit
Diffstat (limited to 'tools/edid/bparse-edid')
-rwxr-xr-xtools/edid/bparse-edid16
1 files changed, 16 insertions, 0 deletions
diff --git a/tools/edid/bparse-edid b/tools/edid/bparse-edid
new file mode 100755
index 0000000..9983102
--- /dev/null
+++ b/tools/edid/bparse-edid
@@ -0,0 +1,16 @@
+#!/usr/bin/env python3
+import argparse
+
+parser = argparse.ArgumentParser()
+parser.add_argument('edid_file', type=str, help="edid file")
+args = parser.parse_args()
+
+f = open(args.edid_file, 'rb')
+edid = f.read()
+x = edid[56] | ((edid[58] & 0xf0) << 4)
+y = edid[59] | ((edid[61] & 0xf0) << 4)
+
+print("resolution: {} x {}".format(x, y))
+
+f.close()
+