diff options
Diffstat (limited to 'tests/testpat.cpp')
-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); |