| Age | Commit message (Collapse) | Author |
|
|
|
git-subtree-dir: subprojects/pixpat
git-subtree-split: d444626e6ba988ec6d487800721e447f94b1eaf5
|
|
|
|
|
|
|
|
|
|
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
|
|
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
|
|
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>
|
|
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
|
|
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
|
|
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
|
|
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
|
|
|
|
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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
|
|
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
|
|
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.
|
|
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.
|
|
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.
|
|
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
|
|
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
|
|
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>
|
|
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
|
|
Current workflow seems to be failing, but apt update helps.
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
|
|
|
|
|
|
|
|
|
|
Use dup() on the given fds, and take ownership of them. close() at
destructor.
Fixes: #46
|
|
|
|
|
|
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
|
|
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>
|
|
|
|
|
|
|
|
|
|
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
|
|
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>
|
|
|
|
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
|
|
Only Y8 and Y10_P32 can be used and have been tested for now.
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
|
|
|
|
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>
|
|
|