summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>2017-02-12 16:45:45 +0200
committerTomi Valkeinen <tomi.valkeinen@ti.com>2017-02-13 09:55:05 +0200
commit0b63670dc68561e1d3ffd83d9d024a6320ad91d5 (patch)
tree129f992a8398b46585b28117f83ea5c61253dd38
parentbddac89707f53eb4f15386819faa2b76d590da21 (diff)
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 <laurent.pinchart@ideasonboard.com> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
-rw-r--r--utils/kmsview.cpp12
1 files 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 <ms>] <file> <width> <height> <fourcc>\n\n"
+ "Usage: kmsview [options] <file> <width> <height> <fourcc>\n\n"
"Options:\n"
- " -t, --time Milliseconds to sleep between frames\n"
+ " -c, --connector <name> Output connector\n"
+ " -t, --time <ms> 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");