py: db.py: Add command line argument to specify connector
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>
Thu, 2 Mar 2017 19:47:36 +0000 (21:47 +0200)
committerTomi Valkeinen <tomi.valkeinen@ti.com>
Fri, 3 Mar 2017 07:59:56 +0000 (09:59 +0200)
When a command line argument is present, its value is used as a
connector name that the script will try to use.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
py/tests/db.py

index f0a962d..eb31669 100755 (executable)
@@ -56,10 +56,14 @@ class FlipHandler(pykms.PageFlipHandlerBase):
         else:
             crtc.page_flip(fb, self)
 
+if len(sys.argv) > 1:
+    conn_name = sys.argv[1]
+else:
+    conn_name = ''
 
 card = pykms.Card()
 res = pykms.ResourceManager(card)
-conn = res.reserve_connector()
+conn = res.reserve_connector(conn_name)
 crtc = res.reserve_crtc(conn)
 mode = conn.get_default_mode()