summaryrefslogtreecommitdiff
path: root/utils
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-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-08kmstest: Add -t|--timeTomi 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>
2026-03-20utils: Add -C|--card optionTomi Valkeinen
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
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: 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-08-07kmsprint: Use fourccs, not PixelFormatsTomi Valkeinen
2025-04-22Fix a few clang warningsTomi Valkeinen
2025-03-28kmstest: Support format names in addition to fourccTomi Valkeinen
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
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-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>
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-06Fix issues related to utils & libutilsTomi Valkeinen
Fix dependency issues related to libutils, wrong use of libutils_enabled. Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
2023-09-15kmstest: Support signed values for crtc_[xy]Dave Stevenson
Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
2023-09-12kmsprint: Correct crtc_[xy] to being signed valuesDave Stevenson
These values are signed int32_t, so print them as such for when the plane is partially off screen to the top or left. Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
2023-08-17kmstest: allow using undefined sync polaritiesTomi Valkeinen
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
2023-02-24Drop v4l2Tomi Valkeinen
Drop (hacky) v4l2 support from kms++, and move it to a new, separate, library. 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-20Fix dependency to kms++utils in kmscube and utilsTomi Valkeinen
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
2022-12-18fbtest: fix for 16 bppTomi Valkeinen
2022-11-01kmsxx: Also report format of framebufferDom Cobley
Signed-off-by: Dom Cobley <popcornmix@gmail.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-12-16Remove CMake supportTomi Valkeinen
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@iki.fi>
2020-12-01Fix clang-tidy reported issuesTomi Valkeinen
2020-10-09rename omap wb utils to omap-wbTomi Valkeinen
2020-10-09Bulk format of all filesTomi Valkeinen
2020-09-14Add meson buildTomi Valkeinen
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2020-09-05kmscapture: remove unneeded xf86drm.h includeTomi Valkeinen
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2020-08-10card: Rename has_has_universal_planes to has_universal_planesLaurent Pinchart
The has_has_universal_planes() method name includes a typo, fix it. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2020-05-15kmstest: allow enabling output without anything connectedTomi Valkeinen
Allow kmstest to enable an output without anything connected, if the user gives a videomode. DRM framework allows this, and is needed for testing. Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2020-04-21kmstest: add crc16 printTomi Valkeinen
Add an option to print crc16 for the framebuffer contents.
2020-04-21Add simple kmstouch test toolTomi Valkeinen
Only single touch supported, and pretty naive implementation.
2020-04-21kmsprint: use Videomode::to_string_longTomi Valkeinen
2019-11-06Split dmabuf support from ExtFramebuffer into DmabufFramebufferTomi Valkeinen
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2019-10-28kmstest: convert to fmt::printTomi Valkeinen
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2019-09-25kmsprint: use fmt instead of printf and sformatTomi Valkeinen
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2019-09-25wbm2m: use fmt::formatTomi 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-09-25wbm2m: add informative printsTomi Valkeinen
2019-07-30kmsprint: add missing --device from usageTomi Valkeinen
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2019-01-17card: another try with card constructorsTomi Valkeinen
Let's try again with the card constructors. Card::open_modesetting_card() is removed. The main constructor is Card(const std::string& dev_path = ""). If dev_path is set, the device node with that path is used. If dev_path is not set, the behavior is similar as previously, except a modeset capable card is used at the third step: - 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, the first modeset capable card is opened. Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2019-01-17Revert "kmstest: use open_modesetting_card"Tomi Valkeinen
This reverts commit c223cffa20d617863bffb0c7e3890172d93a53c8.
2019-01-14kmstest: use open_modesetting_cardTomi Valkeinen
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>