aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHans Verkuil <hverkuil-cisco@xs4all.nl>2021-03-20 09:58:12 +0100
committerHans Verkuil <hverkuil-cisco@xs4all.nl>2021-03-20 09:58:12 +0100
commit2bdd37f940d987e84b8091101e20f0218db21bdd (patch)
treec1dfa1f0d4aef225290f3376ae30074b5ae78449
parent3b40439f3e3b22350bfd299fb14fc0f029709a28 (diff)
edid-decode: add --only-hex-dump option
This option only shows the hex dump of the EDID and doesn't do any parsing. Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
-rw-r--r--edid-decode.13
-rw-r--r--edid-decode.cpp13
2 files changed, 12 insertions, 4 deletions
diff --git a/edid-decode.1 b/edid-decode.1
index c9ad10c..e87570f 100644
--- a/edid-decode.1
+++ b/edid-decode.1
@@ -216,6 +216,9 @@ for use with the V4L2 VIDIOC_S_DV_TIMINGS ioctl.
\fB\-s\fR, \fB\-\-skip\-hex\-dump\fR
Skip the initial hex dump of the EDID.
.TP
+\fB\-H\fR, \fB\-\-only\-hex\-dump\fR
+Only show the hex dump of the EDID, then exit.
+.TP
\fB\-\-skip\-sha\fR
Don't show the SHA hash. Normally edid-decode will show the SHA, i.e. the
hash of the git commit used to compile edid-decode. This uniquely identifies
diff --git a/edid-decode.cpp b/edid-decode.cpp
index 78398d0..07bcbe8 100644
--- a/edid-decode.cpp
+++ b/edid-decode.cpp
@@ -42,17 +42,18 @@ enum output_format {
enum Option {
OptCheck = 'c',
OptCheckInline = 'C',
+ OptFBModeTimings = 'F',
OptHelp = 'h',
+ OptOnlyHexDump = 'H',
+ OptLongTimings = 'L',
OptNativeTimings = 'n',
OptOutputFormat = 'o',
OptPreferredTimings = 'p',
OptPhysicalAddress = 'P',
- OptLongTimings = 'L',
+ OptSkipHexDump = 's',
OptShortTimings = 'S',
- OptFBModeTimings = 'F',
- OptXModeLineTimings = 'X',
OptV4L2Timings = 'V',
- OptSkipHexDump = 's',
+ OptXModeLineTimings = 'X',
OptSkipSHA = 128,
OptHideSerialNumbers,
OptVersion,
@@ -78,6 +79,7 @@ static struct option long_options[] = {
{ "preferred-timings", no_argument, 0, OptPreferredTimings },
{ "physical-address", no_argument, 0, OptPhysicalAddress },
{ "skip-hex-dump", no_argument, 0, OptSkipHexDump },
+ { "only-hex-dump", no_argument, 0, OptOnlyHexDump },
{ "skip-sha", no_argument, 0, OptSkipSHA },
{ "hide-serial-numbers", no_argument, 0, OptHideSerialNumbers },
{ "version", no_argument, 0, OptVersion },
@@ -129,6 +131,7 @@ static void usage(void)
" -F, --fbmode Report all long video timings in fb.modes format.\n"
" -V, --v4l2-timings Report all long video timings in v4l2-dv-timings.h format.\n"
" -s, --skip-hex-dump Skip the initial hex dump of the EDID.\n"
+ " -H, --only-hex-dump Only output the hex dump of the EDID.\n"
" --skip-sha Skip the SHA report.\n"
" --hide-serial-numbers Replace serial numbers with '...'\n"
" --version show the edid-decode version (SHA)\n"
@@ -1186,6 +1189,8 @@ int edid_state::parse_edid()
printf("edid-decode (hex):\n\n");
for (unsigned i = 0; i < num_blocks; i++) {
hex_block("", edid + i * EDID_PAGE_SIZE, EDID_PAGE_SIZE, false);
+ if (i == num_blocks - 1 && options[OptOnlyHexDump])
+ return 0;
printf("\n");
}
printf("----------------\n\n");

Privacy Policy