summaryrefslogtreecommitdiff
path: root/py/pykms/pykmsbase.cpp
AgeCommit message (Collapse)Author
2022-06-09card: Add support for writeback connectorsLaurent Pinchart
Enable enumeration of writeback connectors if both libdrm and the device support it. The new Card::has_writeback() method report if the card support writeback connectors. Existing code that expect all connectors to model an output may be confused by the sudden availability of new connectors. To handle this issue, - add a KMSXX_DISABLE_WRITEBACK_CONNECTORS environment variable to disable enumeration of writeback connectors, similarly to universal planes ; and - ignore writeback connectors where no specific connector is requested (Card::get_first_connected_connector(), ResourceManager::reserve_connector() if no connector name is specified, and applications that use all connected outputs). Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2021-07-19py: Property: Add type, enums, values, and __repr__Noralf Trønnes
Also add PropertyType which is used by the type property. Signed-off-by: Noralf Trønnes <noralf@tronnes.org>
2021-07-19py: Card: Add .propertiesNoralf Trønnes
Signed-off-by: Noralf Trønnes <noralf@tronnes.org>
2021-07-19py: Framebuffer: Add flush and __repr__Noralf Trønnes
Signed-off-by: Noralf Trønnes <noralf@tronnes.org>
2021-01-14py: add fourcc_to_pixelformatTomi Valkeinen
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
2020-12-03crtc: add legacy gamma setTomi Valkeinen
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2020-10-09Bulk format of all filesTomi Valkeinen
2020-10-09dmabuffb: add constructor which takes in string fourccTomi Valkeinen
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2020-10-03py: move framebuffer functions to correct placeTomi Valkeinen
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2020-10-02Small Property improvementsTomi Valkeinen
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2020-08-10kms++: Add support for missing 8 -and 16-bit RGB formatsLaurent Pinchart
Add support for the RGB332, XRGB1555 and XRGB4444 formats to the PixelFormat class, the Python API, and the drawing utilities. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2020-08-10kms++: Add support for the planar YUV formatsLaurent Pinchart
Add support for the 6 planar YUV formats (YUV and YVU, combined with 420, 422 or 444 subsampling) to the PixelFormat class, the Python API, and the drawing utilities. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2020-08-10kms++: Add support for semiplanar YUV422 formats (NV16 and NV61)Laurent Pinchart
Add support for the NV16 and NV61 pixel formats to the PixelFormat class, the Python API, and the drawing utilities. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2020-08-10pykmsbase: Add missing pixel formatsLaurent Pinchart
Several pixel formats defined in the C++ PixelFormat class are missing from the Python API. Add them. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2020-08-10card: Add a method to retrieve the device minorLaurent Pinchart
The device minor number is needed to access the debugfs directory corresponding to the device. Make it available to users through a dev_minor() method on the Card object. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2019-11-06pykmsbase: upgrade Blob __init__ to fix deprecation warningTomi Valkeinen
2019-11-06Split dmabuf support from ExtFramebuffer into DmabufFramebufferTomi Valkeinen
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2019-09-25videomode to_string improvementsTomi Valkeinen
Add to_string_short() and to_string_long() to videomode (using the fmt library) for easy printing of videomodes. Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2019-01-17Revert "py: add open_modesetting_card"Tomi Valkeinen
This reverts commit 27f1c296c4f5996227b28215400c787ea018862b.
2019-01-14py: add open_modesetting_cardTomi Valkeinen
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2019-01-14Card: improve DRM card selectionTomi Valkeinen
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>
2019-01-14Card: add support to get the driver nameTomi Valkeinen
Add support to get the driver name. Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2019-01-09pykms: expose Card(device) constructorTomi Valkeinen
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2017-12-08py: add convert_vector helperTomi Valkeinen
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2017-12-08py: Add Card crtcs and encoders properties back to the Python bindingsLaurent Pinchart
Commit 706a44abb3aa ("Update to latest pybind11") removed the crtcs and encoders properties from the Card class. Add them back by wrapping the associated C++ methods manually due to a limitation of pybind11. Fixes: 706a44abb3aa ("Update to latest pybind11") Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2017-12-08Fix Python bindings for Connector::get_possible_crtcs() methodLaurent Pinchart
The method returns an std::vector of DRMObject, which isn't supported by the latest pybind11 as explained in commit 706a44abb3aa. Fix it by wrapping the method manually. Fixes: 706a44abb3aa ("Update to latest pybind11") Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2017-11-24pykms: keep Card alive until Blob is goneTomi Valkeinen
2017-11-24Update to latest pybind11Tomi Valkeinen
Update to latest pybind11 HEAD. We can't use the latest tag (v2.2.0) as it has a regression. There were two problems when updating: 1) Difficulty in managing DrmObject derived classes Most of the DrmObjects are owned by Card, and can't be allocated or freed, but a few of them are allocated and freed by the user. For the former, we need to use unique_ptr with py::nodelete, but that prevents the latter from working. The solution was to not tell the python that the latter classes derive from DrmObject. This seems to be missing feature in pybind11, but I think we can live with it. 2) DrmObjects in STL containers vector<T> where T is a DrmObject derived class doesn't work. We need to have a manual wrapper to return vector<unique_ptr<T, py::nodelete>> instead. This also seems to be a pybind11 missing feature. Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2017-10-20Crtc: add set_mode() which doesn't take a fbTomi Valkeinen
2017-10-03Rework framebuffer classesTomi Valkeinen
Drop (I)MappedFramebuffer, as it doesn't really provide any value, and have most of the methods be present in IFramebuffer with default exception throwing implementation. This gives us simpler way to use the framebuffers, as almost always we can just use a pointer to IFramebuffer.
2017-09-05py: drop the fancy event handlingTomi Valkeinen
Unfortunately the nice event handler added previously doesn't work: we may get multiple page-flip events, which would lead to unref'ing the passed python object multiple times, leading to memory corruption. I guess it's only possible to pass a plain int as user data to commit() and page_flip().
2017-05-31Add DrmPropObject.get_prop() and Property.enums to pykmsbase.cpp.Jyri Sarha
2017-05-31Add Crtc::disable_mode() to pykmsbase.cpp.Jyri Sarha
2017-05-17pykms: add videomode related featuresTomi Valkeinen
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2017-04-26Add Connector.connected to pykmsbasePeter Ujfalusi
It can be used to check if the connector is connected or not Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2017-03-17py: add DrmObject.idxTomi Valkeinen
2017-03-16Add color format related methods and memebers to pykmsbase.Jyri Sarha
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2017-03-16Add Videomode::to_blob method to pykmsbase.Jyri Sarha
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2017-03-13py: fix AtomicReq.commit() return valueTomi Valkeinen
2017-03-08New event handlingTomi Valkeinen
The current event handling relies on the PageFlipHandlerBase class which has to be implemented on the python side. This patch implements a more versatile event handling, where any python object can be passed as data to the commit or page flip, and it's up to the python implementation to decide what to do with that data when receiving the event. Note that when doing the commit or page_flip, the ref count of the given python object is incremented to keep it alive. The ref count is decremented when reading the events with the new helper method card.read_events(). This helper _has_ to be used to ensure the objects get released properly. Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2017-02-13py: Expose AtomicReq::add(std::map<>) methodLaurent Pinchart
Only the AtomiqReq::add version that takes a single property is currently exposed through the Python bindings. Expose the add method that takes a list of properties as well. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2017-02-10py: add ExtFramebufferTomi Valkeinen
2017-02-10py: add DumbFb propertiesTomi Valkeinen
2017-01-25Add refresh() to connector, crtc and encoderTomi Valkeinen
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2017-01-24pykms: add Videomode.__repr__Tomi Valkeinen
2017-01-03py: Reorganize source directoryLaurent Pinchart
Separate the Python bindings sources from the test scripts. While at it, remove the unneeded run.sh script. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>