From 60586e12ad31a7241fd531eee0e41ef20625f7e3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Noralf=20Tr=C3=B8nnes?= Date: Mon, 19 Jul 2021 18:17:54 +0200 Subject: py: Framebuffer: Add flush and __repr__ MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Noralf Trønnes --- py/pykms/pykmsbase.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/py/pykms/pykmsbase.cpp b/py/pykms/pykmsbase.cpp index 382ef6f..b3ada1b 100644 --- a/py/pykms/pykmsbase.cpp +++ b/py/pykms/pykmsbase.cpp @@ -148,6 +148,9 @@ void init_pykmsbase(py::module& m) .def("offset", &Framebuffer::offset) .def("fd", &Framebuffer::prime_fd) + .def("flush", (void (Framebuffer::*)(void)) & Framebuffer::flush) + .def("flush", (void (Framebuffer::*)(uint32_t x, uint32_t y, uint32_t width, uint32_t height)) & Framebuffer::flush) + // XXX pybind11 doesn't support a base object (DrmObject) with custom holder-type, // and a subclass with standard holder-type. // So we just copy the DrmObject members here. @@ -161,6 +164,7 @@ void init_pykmsbase(py::module& m) py::keep_alive<1, 2>()) // Keep Card alive until this is destructed .def(py::init(), py::keep_alive<1, 2>()) // Keep Card alive until this is destructed + .def("__repr__", [](const DumbFramebuffer& o) { return ""; }) ; py::class_(m, "DmabufFramebuffer") @@ -168,6 +172,7 @@ void init_pykmsbase(py::module& m) py::keep_alive<1, 2>()) // Keep Card alive until this is destructed .def(py::init, vector, vector>(), py::keep_alive<1, 2>()) // Keep Card alive until this is destructed + .def("__repr__", [](const DmabufFramebuffer& o) { return ""; }) ; py::enum_(m, "PixelFormat") -- cgit v1.2.3