diff options
author | Jyri Sarha <jsarha@ti.com> | 2015-10-20 16:56:42 +0300 |
---|---|---|
committer | Jyri Sarha <jsarha@ti.com> | 2015-10-20 22:41:38 +0300 |
commit | da88e53621581fa84bf014cca0cb63b417bb131b (patch) | |
tree | d7a084c0c2afc8d17f30f5f68c805e11e8c051d7 | |
parent | f8f92d455c4a915a894111e00dd6f5ec1888bee5 (diff) |
tests/testpat: Add -m flag
-rw-r--r-- | tests/testpat.cpp | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/tests/testpat.cpp b/tests/testpat.cpp index 52e9713..13fea9e 100644 --- a/tests/testpat.cpp +++ b/tests/testpat.cpp @@ -4,13 +4,19 @@ #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"); @@ -30,6 +36,9 @@ int main() 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); |