diff options
Diffstat (limited to 'py/pykms/pykmsbase.cpp')
-rw-r--r-- | py/pykms/pykmsbase.cpp | 18 |
1 files changed, 6 insertions, 12 deletions
diff --git a/py/pykms/pykmsbase.cpp b/py/pykms/pykmsbase.cpp index 604e07c..e53fe54 100644 --- a/py/pykms/pykmsbase.cpp +++ b/py/pykms/pykmsbase.cpp | |||
@@ -53,13 +53,10 @@ void init_pykmsbase(py::module &m) | |||
53 | .def("set_mode", &Crtc::set_mode) | 53 | .def("set_mode", &Crtc::set_mode) |
54 | .def("disable_mode", &Crtc::disable_mode) | 54 | .def("disable_mode", &Crtc::disable_mode) |
55 | .def("page_flip", | 55 | .def("page_flip", |
56 | [](Crtc* self, Framebuffer& fb, py::object ob) | 56 | [](Crtc* self, Framebuffer& fb, uint32_t data) |
57 | { | 57 | { |
58 | // This adds a ref to the object, and must be unpacked with __ob_unpack_helper() | 58 | self->page_flip(fb, (void*)(intptr_t)data); |
59 | PyObject* pob = ob.ptr(); | 59 | }, py::arg("fb"), py::arg("data") = 0) |
60 | Py_XINCREF(pob); | ||
61 | self->page_flip(fb, pob); | ||
62 | }) | ||
63 | .def("set_plane", &Crtc::set_plane) | 60 | .def("set_plane", &Crtc::set_plane) |
64 | .def_property_readonly("possible_planes", &Crtc::get_possible_planes) | 61 | .def_property_readonly("possible_planes", &Crtc::get_possible_planes) |
65 | .def_property_readonly("primary_plane", &Crtc::get_primary_plane) | 62 | .def_property_readonly("primary_plane", &Crtc::get_primary_plane) |
@@ -196,13 +193,10 @@ void init_pykmsbase(py::module &m) | |||
196 | .def("add", (void (AtomicReq::*)(DrmPropObject*, const map<string, uint64_t>&)) &AtomicReq::add) | 193 | .def("add", (void (AtomicReq::*)(DrmPropObject*, const map<string, uint64_t>&)) &AtomicReq::add) |
197 | .def("test", &AtomicReq::test, py::arg("allow_modeset") = false) | 194 | .def("test", &AtomicReq::test, py::arg("allow_modeset") = false) |
198 | .def("commit", | 195 | .def("commit", |
199 | [](AtomicReq* self, py::object ob, bool allow) | 196 | [](AtomicReq* self, uint32_t data, bool allow) |
200 | { | 197 | { |
201 | // This adds a ref to the object, and must be unpacked with __ob_unpack_helper() | 198 | return self->commit((void*)(intptr_t)data, allow); |
202 | PyObject* pob = ob.ptr(); | 199 | }, py::arg("data") = 0, py::arg("allow_modeset") = false) |
203 | Py_XINCREF(pob); | ||
204 | return self->commit(pob, allow); | ||
205 | }, py::arg("data"), py::arg("allow_modeset") = false) | ||
206 | .def("commit_sync", &AtomicReq::commit_sync, py::arg("allow_modeset") = false) | 200 | .def("commit_sync", &AtomicReq::commit_sync, py::arg("allow_modeset") = false) |
207 | ; | 201 | ; |
208 | } | 202 | } |