summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: f8f92d4)
raw | patch | inline | side by side (parent: f8f92d4)
author | Jyri Sarha <jsarha@ti.com> | |
Tue, 20 Oct 2015 13:56:42 +0000 (16:56 +0300) | ||
committer | Jyri Sarha <jsarha@ti.com> | |
Tue, 20 Oct 2015 19:41:38 +0000 (22:41 +0300) |
tests/testpat.cpp | patch | blob | history |
diff --git a/tests/testpat.cpp b/tests/testpat.cpp
index 52e97134f729770ac3a7839c49b1ac20a1dc41b0..13fea9e8e24e5caa898bdaa00155184c196664c8 100644 (file)
--- a/tests/testpat.cpp
+++ b/tests/testpat.cpp
#include "kms++.h"
#include "test.h"
+#include "cmdoptions.h"
using namespace std;
using namespace kms;
-int main()
+static map<string, CmdOption> options = {
+ { "m", HAS_PARAM("Set display mode, for example 1920x1080") },
+};
+
+int main(int argc, char **argv)
{
Card card;
+ CmdOptions opts(argc, argv, options);
if (card.master() == false)
printf("Not DRM master, modeset may fail\n");
auto mode = conn->get_default_mode();
+ if (opts.is_set("m"))
+ mode = conn->get_mode(opts.opt_param("m"));
+
auto fb = new DumbFramebuffer(card, mode.hdisplay, mode.vdisplay, PixelFormat::XRGB8888);
draw_test_pattern(*fb);
fbs.push_back(fb);