| Age | Commit message (Collapse) | Author |
|
|
|
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>
|
|
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 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 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.
|
|
|
|
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
|
|
Add new parameters:
--pattern=PAT
--rec=REC
--range=RANGE
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
|
|
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
|
|
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>
|
|
Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
|
|
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
|
|
|
|
|
|
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>
|
|
Add an option to print crc16 for the framebuffer contents.
|
|
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
|
|
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>
|
|
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>
|
|
This reverts commit c223cffa20d617863bffb0c7e3890172d93a53c8.
|
|
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
|
|
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
|
|
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
|
|
When using kmstest without parameters, use only connectors in Connected
state, not in Unknown state. To use Uknown state connectors, the
connector must be specified in the cmdline.
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
|
|
If a connector doesn't already have a crtc, we might get "Could not find
available crtc" error from kmstest as it fails to search for the crtc.
Fix this.
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
|
|
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
|
|
In the new order the planes are not reserved before the whole command
line is parsed. This way we know the color format of the framebuffer
that is going to be on the reserved plane and we can select a plane
that supports the format. After this patch kmstest makes no distinction
between primary and overlay planes if atomic mode setting is
supported. If no plane is specified then a default plane, matching the
screen size is created.
Signed-off-by: Jyri Sarha <jsarha@ti.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
|
|
Non atomic modesetting is not supported and there is no translation
from various property types to unsigned 64-bit integer. Instead the
property values are simply converted from string with stoull(str, 0, 0).
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
|
|
|
|
|
|
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.
|
|
DRM sends page flips for each crtc in a commit. kmstest expected to get
a single flip event for a single commit, which caused --sync not to work
with two displays.
Fix this by making kmstest skip the first flip event.
|
|
|
|
|
|
|
|
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
|
|
|
|
|
|
|
|
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
|
|
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
|
|
Bad output used to get the crtc, causing crash.
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
|
|
We need to ensure that a primary plane is not already in use.
ResourceManager does this for us.
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
|
|
Use MappedFramebuffer instead of DumbFramebuffer in kmstest, except when
creating the object. This change makes it possible to easily use other
framebuffer objects in kmstest than DumbFramebuffer.
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
|
|
Instead of searching through the dmt and cea tables (if user has given
the option), lets be more explicit about it. Only look for the mode from
a single source, and fail if not found there.
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
|
|
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
|
|
With atomic modesetting we can enable the crtc without a primary plane.
This allows enabling only a plane on the screen.
Change set_crtcs_n_planes() to allow this.
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
|
|
Support custom videomodes when specifying a crtc.
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
|