summaryrefslogtreecommitdiff
path: root/kms++util/src/testpat.cpp
AgeCommit message (Collapse)Author
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-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-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-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>
2020-10-09Bulk format of all filesTomi Valkeinen
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>
2019-04-09add support for more pixel formatsTomi Valkeinen
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@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-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>
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-06-05testpat: fix the location of second diagonal lineTomi Valkeinen
2017-05-31Add different YCbCr encodings.Jyri Sarha
2017-05-18testpat: white box in top left cornerTomi Valkeinen
2017-02-10fix race issue in threaded test pattern drawTomi Valkeinen
2016-08-15Add missing BGR color formats to draw_test_pattern_part().Jyri Sarha
2016-06-16Support RGB888Tomi Valkeinen
2016-06-11kms++util: split to subdirsTomi Valkeinen