summaryrefslogtreecommitdiff
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-08github: drop -Db_ltoTomi Valkeinen
Finding an LTO capable linker seems to fail for clang.
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-08Merge commit 'e0b7d30fd437292c88141fb08d60681870b86c6e' as 'subprojects/pixpat'Tomi Valkeinen
2026-05-08Squashed 'subprojects/pixpat/' content from commit d444626Tomi Valkeinen
git-subtree-dir: subprojects/pixpat git-subtree-split: d444626e6ba988ec6d487800721e447f94b1eaf5
2026-05-08github: Update CITomi Valkeinen
2026-05-08kms++: Add ABGR1555, ABGR4444, XBGR1555, and XBGR4444Tomi Valkeinen
2026-05-08kmstest: Add -t|--timeTomi Valkeinen
2026-05-08kms++: Update pixel formats to latest upstreamTomi Valkeinen
2026-05-07Remove empty .gitmodulesTomi Valkeinen
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
2026-04-30kms: Drop unused includesTomi Valkeinen
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
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>
2026-04-30ci: Drop old compilers which may not have std::formatTomi Valkeinen
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
2026-03-20DumbFramebuffer: Fix plane size calculations for multiplane formatsTomi Valkeinen
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
2026-03-20utils: Add -C|--card optionTomi Valkeinen
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
2025-12-18github: add code checkersTomi Valkeinen
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
2025-12-18Update mdspan headers to 546d4dd63697c6a331554adb6fe650e09b690812Tomi Valkeinen
2025-12-18testpat: Fix div by zero cppcheck warningTomi Valkeinen
2025-12-18fix: Correct printf format specifiers for unsigned integersTomi Valkeinen
This commit addresses cppcheck warnings about mismatched printf format specifiers (invalidPrintfArgType_sint). The format specifiers %i and %d expect signed integers (int) but the variables being passed are unsigned integers (uint32_t, unsigned). This mismatch can lead to undefined behavior and incorrect output formatting. Changes made: - utils/kmstouch.cpp: Changed %i to %u for event code formatting - utils/kmstouch.cpp: Changed %d to %u for event type and property type formatting - utils/kmsview.cpp: Changed %d to %u for frame number formatting These fixes ensure proper type safety in printf formatting and prevent potential undefined behavior when printing unsigned integer values.
2025-12-18fix: Initialize uninitialized member variablesTomi Valkeinen
This commit addresses cppcheck warnings about member variables that are not properly initialized in constructors (uninitMemberVar). Uninitialized member variables can lead to undefined behavior and unpredictable program execution, making this a critical bug fix. Changes made: - kmscube/cube-gles2.cpp: Initialize m_width and m_height to 0 in GlScene constructor to prevent undefined behavior when these values are used - utils/kmstest.cpp: Initialize m_frame_num and m_flip_count to 0 in FlipState constructor to ensure proper frame counting behavior These fixes prevent potential crashes and ensure deterministic behavior by providing proper initial values for all member variables.
2025-12-18fix: Add explicit keyword to single-argument constructorsTomi Valkeinen
This commit addresses cppcheck warnings about constructors with single arguments that are not marked as explicit (noExplicitConstructor). Single-argument constructors can perform implicit type conversions which may lead to unexpected behavior and bugs. Marking them as explicit prevents these implicit conversions and makes the code more predictable. Changes made: - kmscube/cube-egl.h: Added explicit keyword to EglState constructor - kmscube/cube-gbm.cpp: Added explicit keyword to GbmDevice constructor These changes improve type safety by requiring explicit construction calls and preventing unintended implicit conversions.
2025-12-18fix: Resolve variable shadowing warningsTomi Valkeinen
This commit addresses cppcheck warnings about local variables that shadow outer function names (shadowFunction). Variable shadowing can make code confusing and error-prone as it's unclear which variable is being referenced. Changes made: - kmscube/cube-egl.cpp: Renamed 'config' to 'cfg' in loop to avoid shadowing the config() member function - kmscube/cube-gbm.cpp: Renamed 'width' and 'height' local variables to 'bo_width' and 'bo_height' to avoid shadowing width() and height() member functions These changes improve code clarity and eliminate potential confusion about variable scope and naming.
2025-12-18fix: Replace C-style casts with C++ castsTomi Valkeinen
This commit addresses cppcheck warnings about C-style casts (cstyleCast) by replacing them with appropriate C++ casts. C-style casts are considered dangerous because they can perform unsafe conversions without compile-time type checking, while C++ casts are more explicit and type-safe. Changes made: - static_cast for safe type conversions (e.g., void* to struct*) - reinterpret_cast for pointer type conversions (e.g., uint8_t* to char*) - Combined static_cast and reinterpret_cast for integer-to-pointer conversions Fixed files: - kmscube/cube-gles2.cpp: GLvoid* casts for OpenGL vertex attribute pointers - kmscube/cube-wl.cpp: Wayland interface pointer casts - kmscube/cube-x11.cpp: X11 window handle conversion - utils/fbtest.cpp: mmap return value cast - utils/kmstest.cpp: Framebuffer pointer arithmetic - utils/kmsview.cpp: Framebuffer memory mapping cast
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-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