summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
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-09-08pixelformats: Add missing RAW 16 formatsTomi Valkeinen
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
2025-08-07github: Add apt update, use -yTomi Valkeinen
Current workflow seems to be failing, but apt update helps. Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
2025-08-07kmsprint: Use fourccs, not PixelFormatsTomi Valkeinen
2025-08-07plane: Add support to deal with raw fourccsTomi Valkeinen
2025-08-07framebuffer: Add support to deal with raw fourccsTomi Valkeinen
2025-04-26dmabuffb: Add missing includeTomi Valkeinen
2025-04-26dmabuffb: dup() the fdsTomi Valkeinen
Use dup() on the given fds, and take ownership of them. close() at destructor. Fixes: #46
2025-04-26py: Allow building pykms without libutilsTomi Valkeinen
2025-04-26meson: Add option name to summary printTomi Valkeinen
2025-04-22github: compile with multiple compiler versionsTomi Valkeinen
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
2025-04-22pixelformats: Disable constexpr for older compilersTomi Valkeinen
gcc 11 and earlier do not support constexpr strings and vectors. Add tests and ifdefs to only use constexpr on selected places for gcc 12+. Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
2025-04-22pixelformats: use initializer_list instead of vectorTomi Valkeinen
2025-04-22pixelformats: use string_viewsTomi Valkeinen
2025-04-22kms++utils: conv: Compilation fix for clang 15Tomi Valkeinen
2025-04-22Fix a few clang warningsTomi Valkeinen
2025-04-17color16: Add rounding to YUV-to-RGBTomi Valkeinen
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
2025-04-17color16: Fix RGB-to-YUVTomi Valkeinen
The calculation was not right, producing bad values. Fix it, and this time actually test the output... Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
2025-03-28conv: Add X403 supportTomi Valkeinen
2025-03-28kmstest: Support format names in addition to fourccTomi Valkeinen
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
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-26kmstest: Add test pattern parametersTomi Valkeinen
Add new parameters: --pattern=PAT --rec=REC --range=RANGE Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
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-26Add mdspan includesTomi Valkeinen
From https://github.com/kokkos/mdspan Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
2025-03-26kms++util: Add color16.hTomi Valkeinen
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
2025-03-26PixelFormats: Pull in formats from pixutilsTomi Valkeinen
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
2025-03-26PixelFormats: Switch to non-fourcc PixelFormat enumTomi Valkeinen
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
2025-03-26Use the fourcc helpersTomi Valkeinen
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
2025-03-26PixelFormats: clean fourcc managementTomi Valkeinen
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-03-26py/tests/kmsmodeview.py: Fix indentationTomi Valkeinen
2025-02-11pixelformats: cleanupTomi Valkeinen
2025-02-05testpat: fix exception throwingTomi Valkeinen
2025-02-05Switch to C++20Tomi Valkeinen
2025-02-05clang-format: set ColumnLimit to 90Tomi Valkeinen
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
2024-12-09Implement native visual matchingKaido Kert
Implement matching GBM buffer format to EGL NATIVE_VISUAL_ID. eglChooseConfig cannot match on NATIVE_VISUAL_ID, but GBM/EGL requires matching formats. Similar logic is implemented in kmscube code in match_config_to_visual. X11, Wayland and Null cube demos remain unchanged. Tested on Raspi-4 and VirtualBox/Ubuntu
2024-11-29Make gbm binary respect numframesKaido Kert
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>
2023-11-08py: pic.py: Add simple test for fb.map()Tomi Valkeinen
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
2023-11-07py: Framebuffer: Add map wrappingLI Qingwu
Enables direct Python access to the framebuffer's buffer, facilitating rapid image drawing capabilities. Signed-off-by: LI Qingwu <Qing-wu.Li@leica-geosystems.com.cn> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
2023-11-07kmstest: Don't fail if setting crtc inactive and disabling the planes failsDave Stevenson
Many simple DRM devices (eg SPI) don't support disabling the primary plane when the CRTC is enabled (which is different from the ACTIVE flag from being cleared). This is enforced by the kernel in drm_atomic_helper_check_crtc_primary_plane. Do not exit if that commit fails. Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
2023-10-06meson: Fix more utils dependenciesTomi Valkeinen
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
2023-10-06workflows: Use "meson setup"Tomi Valkeinen
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>