diff options
author | Tomi Valkeinen <tomi.valkeinen@ti.com> | 2017-05-30 13:56:28 +0300 |
---|---|---|
committer | Tomi Valkeinen <tomi.valkeinen@ti.com> | 2017-05-30 14:22:00 +0300 |
commit | 2d86678f0a78abf67cdef6be375f7d787c4f017d (patch) | |
tree | db8602f4f75448706155145b5345dc3009d9fa23 /py/pykms | |
parent | af3f9890cc3927d92de4048bc238d62866784a35 (diff) |
omapfb: add enum Flags for OmapFB
Diffstat (limited to 'py/pykms')
-rw-r--r-- | py/pykms/pykmsomap.cpp | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/py/pykms/pykmsomap.cpp b/py/pykms/pykmsomap.cpp index bad20fb..2074092 100644 --- a/py/pykms/pykmsomap.cpp +++ b/py/pykms/pykmsomap.cpp @@ -14,13 +14,22 @@ void init_pykmsomap(py::module &m) .def(py::init<>()) ; - py::class_<OmapFramebuffer>(m, "OmapFramebuffer", py::base<MappedFramebuffer>()) - .def(py::init<OmapCard&, uint32_t, uint32_t, const string&, bool>(), + py::class_<OmapFramebuffer> omapfb(m, "OmapFramebuffer", py::base<MappedFramebuffer>()); + + // XXX we should use py::arithmetic() here to support or and and operators, but it's not supported in the pybind11 we use + py::enum_<OmapFramebuffer::Flags>(omapfb, "Flags") + .value("None", OmapFramebuffer::Flags::None) + .value("Tiled", OmapFramebuffer::Flags::Tiled) + .export_values() + ; + + omapfb + .def(py::init<OmapCard&, uint32_t, uint32_t, const string&, OmapFramebuffer::Flags>(), py::keep_alive<1, 2>(), // Keep Card alive until this is destructed - py::arg("card"), py::arg("width"), py::arg("height"), py::arg("fourcc"), py::arg("tiled") = false) - .def(py::init<OmapCard&, uint32_t, uint32_t, PixelFormat, bool>(), + py::arg("card"), py::arg("width"), py::arg("height"), py::arg("fourcc"), py::arg("flags") = OmapFramebuffer::None) + .def(py::init<OmapCard&, uint32_t, uint32_t, PixelFormat, OmapFramebuffer::Flags>(), py::keep_alive<1, 2>(), // Keep OmapCard alive until this is destructed - py::arg("card"), py::arg("width"), py::arg("height"), py::arg("pixfmt"), py::arg("tiled") = false) + py::arg("card"), py::arg("width"), py::arg("height"), py::arg("pixfmt"), py::arg("flags") = OmapFramebuffer::None) .def_property_readonly("format", &OmapFramebuffer::format) .def_property_readonly("num_planes", &OmapFramebuffer::num_planes) .def("fd", &OmapFramebuffer::prime_fd) |