summaryrefslogtreecommitdiff
path: root/kms++util/src
AgeCommit message (Collapse)Author
2026-05-11card: Add support for writeback connectorswritebackLaurent 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>
2026-05-11utils: Add a dump_framebuffer() methodLaurent Pinchart
Add a new method to write the contents of a framebuffer to a file descriptor. This can be used to capture frames from writeback connectors. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2026-05-08kmstest: Use pixpat vbar for the moving flip barTomi Valkeinen
Replace the hand-rolled draw_color_bar call in FlipState::draw_bar with pixpat's "vbar" pattern via a new draw_vbar_pattern helper in kms++util. The pattern fills the full buffer, so the old_xpos bookkeeping for clearing the previous bar is no longer needed.
2026-05-08kms++util: Replace test-pattern generator with pixpatTomi Valkeinen
Switch draw_test_pattern() to call libpixpat (linked statically into libkms++util.so) instead of the in-tree pattern generator. Pixpat covers every pattern (kmstest, smpte, solid colors) and every pixel format the previous generator handled, so behavior is unchanged for all callers. Drop the now-unused machinery: conv.h and conv-*.h template writers, color16.h (RGB16/YUV16 plus conversions), the *_old / _single / _multi declarations that had no definitions or callers, and the c_draw_test_pattern C ABI which had no callers anywhere in the tree. RecStandard and ColorRange move from color16.h directly into kms++util.h, since they are still part of the public TestPatternOptions struct.
2026-05-08kms++: Update pixel formats to latest upstreamTomi Valkeinen
2026-04-30Drop libfmtTomi Valkeinen
We can use std::format() and a custom print() wrapper with C++20. When moving to C++23, we can drop the wrapper. Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
2025-12-18testpat: Fix div by zero cppcheck warningTomi Valkeinen
2025-12-18fix: Use const references to avoid unnecessary variable copyingTomi Valkeinen
This commit addresses cppcheck warnings about variables that can be declared as const references (constVariableReference). These variables were being copied unnecessarily when they could be accessed as const references, improving performance and code clarity. Fixed files: - kms++util/src/cpuframebuffer.cpp: Make plane reference const in destructor - kms++util/src/testpat.cpp: Make info and lambda parameter const references - utils/kmstest.cpp: Make loop variable const reference in output parsing
2025-12-18fix: Resolve variable shadowing warningsTomi Valkeinen
Fix cppcheck shadowVariable and shadowArgument warnings by renaming local variables to avoid conflicts: - Rename 'ob' to 'prop' in property creation loop in card.cpp - Rename loop variable 'y_offset' to 'y_off' in conv-yuv-semiplanar.h - Rename local 'y' to 'y_val' in SMPTE pattern generator in testpat.cpp - Rename 'is_last' to 'child_is_last' in entry printing in kmsprint.cpp These changes eliminate naming conflicts while preserving functionality and improving code clarity.
2025-12-18perf: Pass parameters by const reference to avoid copiesTomi Valkeinen
Fix cppcheck performance warnings by passing function parameters by const reference instead of by value, preventing unnecessary copies: - string parameters in open_device_by_path() - set<Connector*> parameters in connector finder functions - vector parameter in FlipState constructor - range variable in kmscapture loop These changes improve performance by avoiding object copies while maintaining the same functionality.
2025-12-18fix: Replace C-style casts with C++ static/reinterpret castsTomi Valkeinen
C-style casts should be replaced with appropriate C++ cast operators for better type safety and code clarity. This change fixes cppcheck style warnings about C-style pointer casting by using: - static_cast for simple pointer type conversions - reinterpret_cast for memory buffer pointer arithmetic The changes maintain identical functionality while following modern C++ best practices for explicit casting.
2025-09-12kms++util: Fix drawing outside fb boundariesTomi Valkeinen
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
2025-09-08kms++util/testpat: Add RAW Bayer testpat generationTomi Valkeinen
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
2025-09-08utils: c_draw_test_pattern() takes format name, not fourccTomi Valkeinen
We can generate test patterns for pixel formats not in DRM, so we can't take DRM fourcc as a parameter for c_draw_test_pattern(). Switch it to format name instead. This is a ABI change, but it is marked as super experimental. Also, it feels a bit odd to add non-DRM format handling to kms++. But it feels a bit pointless to split the testpat generation to a separate library. Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
2025-04-22kms++utils: conv: Compilation fix for clang 15Tomi Valkeinen
2025-03-28conv: Add X403 supportTomi Valkeinen
2025-03-27conv: Add Y8/10/12/16 and Y10_P32 supportTomi Valkeinen
Only Y8 and Y10_P32 can be used and have been tested for now. Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
2025-03-27conv: Drop extra constexpr valueTomi Valkeinen
2025-03-26kms++util: Add draw_test_pattern() with C ABITomi Valkeinen
Add a draw_test_pattern for C ABI (i.e. not C++). This function can be easily called from Python with ctypes, without any kind of bindings. Experimental, ABI can change. Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
2025-03-26kms++util: Add SMPTE test patternTomi Valkeinen
2025-03-26kms++util: New template based conversion & testpat codeTomi Valkeinen
New templated conversion and test pattern code. Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
2025-03-26PixelFormats: New PixelFormatInfo codeTomi Valkeinen
New pixel format code, from Python pixutils library. Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
2025-02-05testpat: fix exception throwingTomi Valkeinen
2023-11-15testpat: Fix memory mapping in threaded drawingLaurent Pinchart
The IFramebuffer::map() function is not thread-safe, which is why the threaded implementation of draw_test_pattern_impl() maps all planes before starting to draw. A typo slipped in the code, resulting in only plane 0 being mapped. This didn't result in an immediate segfault, as drawing operations in the worker threads map the remaining planes. However, due to the implementation of DumbFramebuffer::map(), this can result in the same plane being mapped multiple times, with only one of the mapping recorded in the mapping cache. The other mappings are then leaked, leading not only to extra memory consumption, but also to the DRM device never being released even after the destruction of the Card object. Fix this. Fixes: 40d96062a37c ("Revert "testpat: remove threaded drawing"") Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
2022-12-22Code formatting fixesTomi Valkeinen
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
2022-12-18kms++util: Add Y21x drawing supportTomi Valkeinen
Add support for drawing Y210, Y212, Y216 pixels. Signed-off-by: Tomi Valkeinen <tomi.valkeinen+renesas@ideasonboard.com> Reviewed-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
2022-12-04Fix clang-tidy warningsTomi Valkeinen
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
2021-10-06Split V4L2 code into separate libsTomi Valkeinen
Create v4l2++ library and pyv4l2, which are independent from the rest of the kms++. Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
2020-10-09Bulk format of all filesTomi Valkeinen
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-07-24Use unique_ptr to prevent memory leaks in VideoDevice classdreamer.dead
2020-05-17Merge pull request #54 from ilteroi/gcc10Tomi Valkeinen
fix compiler errors with gcc 10
2020-05-15fix compiler errors with gcc 10Peter Trompeter
2020-05-15resmgr: add release() methodsMatt Hoosier
This makes the ResourceManager class much more functional for uses where the set of resources used to scan out a scene changes from frame to frame. The atomic modesetting API discipline requires a brute-force search to find a compatible pairing of planes/etc, and being able to reserve bits incrementally is much simpler than throwing out the entire resourcemanager and make a new one each time a resource reserved in a tentative attempt to probe its compatibility with an test-mode atomic commit, turns out not to pan out.
2020-04-21videodevice: use exception to catch bad fdTomi Valkeinen
2019-11-06Use [] operator delete to free CPUFramebuffer buffersdreamer.dead
2019-09-25remove unused sformat()Tomi Valkeinen
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2019-09-16videodevice: handle NV12 <-> NM12 translationBenoit Parrot
V4L2 and DRM differ in their interpretation of YUV420::NV12 V4L2 NV12 is a Y and UV co-located planes in a single plane buffer. DRM NV12 is a Y and UV planes presented as dual plane buffer, which is known as NM12 in V4L2. Since here we have hybrid DRM/V4L2 user space helper functions we need to translate DRM::NV12 to V4L2:NM12 pixel format back and forth to keep the data view consistent. Signed-off-by: Benoit Parrot <bparrot@ti.com>
2019-04-09add support for more pixel formatsTomi Valkeinen
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2018-11-01videodevice: Add selection API supportBenoit Parrot
Add selection API support to the VideoSteamer class. Signed-off-by: Benoit Parrot <bparrot@ti.com>
2018-10-17Add AR12 & AR15 supportTomi Valkeinen
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2018-08-23Revert "testpat: remove threaded drawing"Tomi Valkeinen
This reverts commit 33246d9b5fb0347aabd62caac1da03440f9e1634. Add threaded drawing back, but have it behind a CMAKE variable so that it can easily be turned off. Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2018-08-03add a simple draw_circle()Tomi Valkeinen
2018-05-22testpat: remove threaded drawingTomi Valkeinen
Threading causes easily issues with (at least) static linking. Let's just remove it as it's not really that important. Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2018-01-09add safeguards to draw_*_pixel() to prevent memory corruptionTomi Valkeinen
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2017-12-15videodevice: Fix minor spacingKieran Bingham
Provide a space between the return type and the function definition Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2017-11-22resman: use set<> instead of vector<>Tomi Valkeinen
2017-11-22kmstest: use resmanTomi Valkeinen