diff options
author | Tomi Valkeinen <tomi.valkeinen@ti.com> | 2019-01-10 13:59:34 +0200 |
---|---|---|
committer | Tomi Valkeinen <tomi.valkeinen@ti.com> | 2019-01-14 09:27:28 +0200 |
commit | f63f1b1a16269ddcce75a61d540429fe3d41cfc8 (patch) | |
tree | 33208ee6969537d7c4d732ba5f052699bdf185e9 /py/pykms | |
parent | 21c70a626cef72804f0ea270ffbae803e76e5b71 (diff) |
Card: improve DRM card selection
Add new Card constructor:
Card(const std::string& driver, uint32_t idx)
which can be used to open Nth card for the given driver.
The default constructor behavior is:
- If KMSXX_DEVICE env variable is set, the card device with that path is
opened.
- If KMSXX_DRIVER env variable is set, the card with the given driver
name and index is opened. The format is either "drvname" or
"drvname:idx".
- If neither env variable is given, open /dev/dri/card0
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Diffstat (limited to 'py/pykms')
-rw-r--r-- | py/pykms/pykmsbase.cpp | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/py/pykms/pykmsbase.cpp b/py/pykms/pykmsbase.cpp index 7a2ce75..668e6e3 100644 --- a/py/pykms/pykmsbase.cpp +++ b/py/pykms/pykmsbase.cpp @@ -22,6 +22,7 @@ void init_pykmsbase(py::module &m) py::class_<Card>(m, "Card") .def(py::init<>()) .def(py::init<const string&>()) + .def(py::init<const string&, uint32_t>()) .def_property_readonly("fd", &Card::fd) .def_property_readonly("get_first_connected_connector", &Card::get_first_connected_connector) |