From 0b63670dc68561e1d3ffd83d9d024a6320ad91d5 Mon Sep 17 00:00:00 2001 From: Laurent Pinchart Date: Sun, 12 Feb 2017 16:45:45 +0200 Subject: kmsview: Add connector command line argument The argument allows specifying which connector to display on. When not set, the current behaviour is preserved. Signed-off-by: Laurent Pinchart Signed-off-by: Tomi Valkeinen --- utils/kmsview.cpp | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/utils/kmsview.cpp b/utils/kmsview.cpp index 6f236a1..04d005d 100644 --- a/utils/kmsview.cpp +++ b/utils/kmsview.cpp @@ -24,9 +24,10 @@ static void read_frame(ifstream& is, DumbFramebuffer* fb, Crtc* crtc, Plane* pla } static const char* usage_str = - "Usage: kmsview [-t ] \n\n" + "Usage: kmsview [options] \n\n" "Options:\n" - " -t, --time Milliseconds to sleep between frames\n" + " -c, --connector Output connector\n" + " -t, --time Milliseconds to sleep between frames\n" ; static void usage() @@ -38,8 +39,13 @@ int main(int argc, char** argv) { uint32_t time = 0; string dev_path = "/dev/dri/card0"; + string conn_name; OptionSet optionset = { + Option("c|connector=", [&conn_name](string s) + { + conn_name = s; + }), Option("|device=", [&dev_path](string s) { dev_path = s; @@ -81,7 +87,7 @@ int main(int argc, char** argv) Card card(dev_path); ResourceManager res(card); - auto conn = res.reserve_connector(); + auto conn = res.reserve_connector(conn_name); auto crtc = res.reserve_crtc(conn); auto plane = res.reserve_overlay_plane(crtc, pixfmt); FAIL_IF(!plane, "available plane not found"); -- cgit v1.2.3