py: add open_modesetting_card
authorTomi Valkeinen <tomi.valkeinen@ti.com>
Fri, 11 Jan 2019 10:29:40 +0000 (12:29 +0200)
committerTomi Valkeinen <tomi.valkeinen@ti.com>
Mon, 14 Jan 2019 07:27:28 +0000 (09:27 +0200)
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
py/pykms/pykmsbase.cpp
py/tests/test.py

index 668e6e3..4b46d55 100644 (file)
@@ -20,6 +20,8 @@ static vector<unique_ptr<T, py::nodelete>> convert_vector(const vector<T*>& sour
 void init_pykmsbase(py::module &m)
 {
        py::class_<Card>(m, "Card")
+                       .def_static("open_modesetting_card", []() { return Card::open_modesetting_card(); })
+
                        .def(py::init<>())
                        .def(py::init<const string&>())
                        .def(py::init<const string&, uint32_t>())
index 83cf16a..45cf6e9 100755 (executable)
@@ -13,7 +13,7 @@ args = parser.parse_args()
 if args.omap:
        card = pykms.OmapCard()
 else:
-       card = pykms.Card()
+       card = pykms.Card.open_modesetting_card()
 
 res = pykms.ResourceManager(card)
 conn = res.reserve_connector(args.connector)