summaryrefslogtreecommitdiff
path: root/Userland/Utilities/edid-dump.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Userland/Utilities/edid-dump.cpp')
-rw-r--r--Userland/Utilities/edid-dump.cpp38
1 files changed, 38 insertions, 0 deletions
diff --git a/Userland/Utilities/edid-dump.cpp b/Userland/Utilities/edid-dump.cpp
new file mode 100644
index 0000000000..2ac465b249
--- /dev/null
+++ b/Userland/Utilities/edid-dump.cpp
@@ -0,0 +1,38 @@
+/*
+ * Copyright (c) 2022, Liav A. <liavalb@hotmail.co.il>
+ *
+ * SPDX-License-Identifier: BSD-2-Clause
+ */
+
+#include <AK/String.h>
+#include <AK/StringUtils.h>
+#include <LibCore/ArgsParser.h>
+#include <LibCore/System.h>
+#include <LibEDID/EDID.h>
+#include <LibMain/Main.h>
+#include <assert.h>
+#include <errno.h>
+#include <fcntl.h>
+#include <inttypes.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <sys/mman.h>
+#include <sys/stat.h>
+#include <unistd.h>
+
+ErrorOr<int> serenity_main(Main::Arguments arguments)
+{
+ TRY(Core::System::pledge("stdio rpath wpath"));
+
+ StringView display_connector_file_name;
+ Core::ArgsParser args;
+ args.add_positional_argument(display_connector_file_name, "Display Connector Device Path", "display connector file name", Core::ArgsParser::Required::Yes);
+
+ args.parse(arguments);
+
+ auto edid = TRY(EDID::Parser::from_framebuffer_device(display_connector_file_name, 0));
+
+ out("{}", StringView { edid.bytes() });
+ return 0;
+}